From: David Vázquez Date: Wed, 1 May 2013 17:46:48 +0000 (+0100) Subject: Pass argument count explicitly instead of use arguments.length X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=fce50c8d6de70e78e67e14c97acc27a0f145d665;p=jscl.git Pass argument count explicitly instead of use arguments.length --- diff --git a/jscl.html b/jscl.html index 656af67..3cd1330 100644 --- a/jscl.html +++ b/jscl.html @@ -77,26 +77,26 @@ var startPrompt = function () { // Start the prompt with history enabled. - jqconsole.Write(lisp.evalString(pv, '(CL:PACKAGE-NAME CL:*PACKAGE*)') + '> ', 'jqconsole-prompt'); + jqconsole.Write(lisp.evalString(pv, 1, '(CL:PACKAGE-NAME CL:*PACKAGE*)') + '> ', 'jqconsole-prompt'); jqconsole.Prompt(true, function (input) { // Output input with the class jqconsole-return. if (input[0] != ','){ try { - var vs = lisp.evalInput(mv, input); + var vs = lisp.evalInput(mv, 1, input); for (var i=0; i=" - (+ 1 n-required-arguments n-optional-arguments) + "for (var i = nargs-1; i>=" (+ n-required-arguments n-optional-arguments) "; i--)" *newline* - (indent js!rest " = {car: arguments[i], cdr: ") js!rest "};" - *newline*))))) + (indent js!rest " = {car: arguments[i+2], cdr: " js!rest "};" *newline*)))))) (defun compile-lambda-parse-keywords (ll) (let ((n-required-arguments @@ -411,12 +402,12 @@ ;; Parse keywords (flet ((parse-keyword (keyarg) ;; ((keyword-name var) init-form) - (code "for (i=" (+ 1 n-required-arguments n-optional-arguments) - "; i n) throw 'too many arguments'; + if (args > n) throw 'too many arguments'; } function checkArgs(args, n){