Hi Andy, On Sun, Dec 13, 2009 at 9:49 PM, Andy Chu <[email protected]> wrote: > There is a function called "loadCode" for now, that behaves a little > bit like eval: > > var code = loadCode("var foo=3; var bar = function(a) { fn(a) };", > {fn: obj.fn}); > > // code is now {foo: 3, bar: function(a) ...}
Where is this loadCode function implemented? Is this something you wrote yourself? In the Caja project, our "isolated evaluator" is implemented to return the value of the last ExpressionStatement in the code. In other words, the loaded code is more easily able to defend its *own* integrity since its top-level vars are private to it. Ihab -- Ihab A.B. Awad, Palo Alto, CA _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

