From: David Vázquez Date: Sun, 21 Apr 2013 17:29:17 +0000 (+0100) Subject: Define `window' and `globalEval' to work in other js environments X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=a9426a807b6ea5adc09a1eadecb7233337b5aa6a;p=jscl.git Define `window' and `globalEval' to work in other js environments --- diff --git a/prelude.js b/prelude.js index b62c9cf..38a13d7 100644 --- a/prelude.js +++ b/prelude.js @@ -1,8 +1,13 @@ // This file is prepended to the result of compile ecmalisp.lisp, and // contain runtime code that ecmalisp assumes to exist. +var window = this; var nil; +function globalEval (x) { + return eval.call (window, x); +} + function pv (x) { return x==undefined? nil: x; } function mv(){