Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#7290 closed defect (wontfix)

FF3 eval() badly borken, and some bizzareness

Reported by: Mike Wilcox Owned by: anonymous
Priority: high Milestone: future
Component: Core Version: 1.1.1
Keywords: eval firefox ff3 Cc: kriszyp, James Burke, dylan, Adam Peller
Blocked By: Blocking:


After doing some testing with dojo loading, I stumbled across the fact that eval in FF3 is sludge. It's running some 10x to 30x slower. This is against even IE6 on a Mac, which is really embaressing.

There is a ticket referenced here: ...although it's lacking some details that I may need to add.

Now the bizzare part: it's not broken in Dojo. I traced this down to the fact that, for debugging, the sourceUrl is added to the end of the script content. This somehow has the side-effect of "fixing" the bug (using quotes, because it's twice as fast but still damn slow). Here it is, line 111 in loader.js:

if(d.isMoz){ contents += "\r\n//@ sourceURL=" + uri; } // debugging assist for Firebug

In fact, try commenting out this line and running anything. Many times slower.

Kris Zyp mentions using new Function for json (#7053). This bug is why. Json data doesn't have the suffix appended to it.

I've attached a test that demonstrates my findings.

I'm not exactly sure of the solution though. Perhaps using "new Function" for json data is sufficient (IMHO, I would prefer that the loader-eval(script) and dojo.eval(json) were two seperate things anyway).

Attachments (1)

testEval.html (2.1 KB) - added by Mike Wilcox 11 years ago.
Test file for FF3 eval bug (run in other browsers to see the difference)

Download all attachments as: .zip

Change History (5)

Changed 11 years ago by Mike Wilcox

Attachment: testEval.html added

Test file for FF3 eval bug (run in other browsers to see the difference)

comment:1 Changed 11 years ago by Mike Wilcox

comment:2 Changed 11 years ago by Adam Peller

Cc: Adam Peller added

comment:3 Changed 11 years ago by James Burke

Milestone: tbdfuture
Resolution: wontfix
Status: newclosed

This seems like a regression that Firefox needs to fix. So marking this as wontfix for now, but at least we have a ticket we can use to track any other reports of the issue. Give a holler if you do not agree.

comment:4 Changed 11 years ago by Kris Zyp

This issue is almost entirely due to Firebug, not Firefox. I think there might be a slight regression in eval in FF, but it is very minor. One of the major features of Firebug 1.2 (FF3 version) is the ability to debug eval, which means all evals must be processed by Firebug and added to a list of scripts, which is understandably expensive. Which shouldn't complain to much about this, this features makes Dojo debugging vastly easier.

Note: See TracTickets for help on using tickets.