From f15bd27f080e8f61fdcb2ad9e306cd94f0fa9b52 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Fri, 26 Apr 2013 11:32:21 +0100 Subject: [PATCH] js-eval uses globalEval --- src/compiler.lisp | 4 ++-- src/prelude.js | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) 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; } -- 1.7.10.4