On Thu, Jan 22, 2009 at 11:55 AM, <[email protected]> wrote: > > http://codereview.appspot.com/11948/diff/8/9#newcode180 > Line 180: the <code>cajita.manifest()</code> function.</td> > On 2009/01/22 17:39:28, MarkM wrote: > >> calling the caja.manifest() function [with a static JSON literal]. >> >> It would not work to call it with an expression that needs to be >> > evaluated, > >> since the whole point is to enable the manifest to be obtained without >> > (or prior > >> to) calling the module function. >> > > I assume the alternative you propose is for the cajita.manifest() > argument to be a string literal? > > Since we parse the program, we can hoist the parse tree generated by the > argument of cajita.manifest() one level of instantiation upwards into > the module envelope (after checking that it is JSON, which includes > making sure that it has no references to external variables). Making it > part of the parsed program allows us to do this checking more easily, > and allows programmers to use their native syntax highlighters and what > not to write the stuff. >
Actually, I wasn't proposing a string literal. Just a tightening of the language so that the expression argument to caja.manifest is itself expressed in the JSON subset of ES, so that the cajoler knows it can move it into the module manifest without changing its value or violating isolation. -- Cheers, --MarkM
