Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

add Envjs.eval for platfrom specific script eval implementations

#94

-- from a message from steven parkes on the envjs list --

What will make this really killer is using evaluateString to load scripts, rather than raw eval():

http://www.mozilla.org/rhino/apidocs/org/mozilla/javascript/Context...

You pass it the window object for the script and it will cause the string to be evaluated in the correct scope. This is the stuff that Glen was using scope manipulation to achieve.

I think it also has the advantage of passing filename/line number info to the compiler, so the error messages are better. I do that on the SpiderMonkey side in some places but I think we can do more. There are places in env.js where we do a straight eval() where I think we might want to do a platform call, to give it the option to do some value added stuff like filenames. (I think everybody hates that when you do XHR/eval instead of document.write(

You can also do what I do in SpiderMonkey which is use separate compile and execute steps which allows me to cache the compiler output so I only have to compile a script once even if it gets execute multiple times.

Reported by Thatcher · February 6th, 2010 @ 05:55 AM

State: resolved
Milestone: 1.2.x
Assigned to: Thatcher Thatcher

Activity

  1. Thatcher
    Thatcher
    • State changed from open to resolved

    this is done and was helpful in general to allow Envjs on rhino make sure script is evaluated in the correct context

    March 2nd, 2010 @ 07:34 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.