From: David Vázquez Date: Fri, 26 Apr 2013 10:32:21 +0000 (+0100) Subject: js-eval uses globalEval X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=f15bd27f080e8f61fdcb2ad9e306cd94f0fa9b52;p=jscl.git js-eval uses globalEval --- diff --git a/src/compiler.lisp b/src/compiler.lisp index 961d3a0..27cc37b 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -1476,13 +1476,13 @@ (type-check (("string" "string" string)) (if *multiple-value-p* (js!selfcall - "var v = eval.apply(window, [string]);" *newline* + "var v = globalEval(string);" *newline* "if (typeof v !== 'object' || !('multiple-value' in v)){" *newline* (indent "v = [v];" *newline* "v['multiple-value'] = true;" *newline*) "}" *newline* "return values.apply(this, v);" *newline*) - "eval.apply(window, [string])"))) + "globalEval(string)"))) (define-builtin error (string) (js!selfcall "throw " string ";" *newline*)) diff --git a/src/prelude.js b/src/prelude.js index 9a8d363..277a9d9 100644 --- a/src/prelude.js +++ b/src/prelude.js @@ -4,9 +4,7 @@ var window = this; var nil; -function globalEval (x) { - return eval.call (window, x); -} +globalEval = eval; // Just an indirect eval function pv (x) { return x==undefined? nil: x; }