Closed Bug 595555 Opened 15 years ago Closed 15 years ago

JSOPTION_ANONFUNFIX should be set in js shell

Categories

(Core :: JavaScript Engine, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0

People

(Reporter: brendan, Assigned: brendan)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

This option makes eval("function(){}") an error, per ECMA-262. The eval is just for example, another example would be (in HTML): <script>function(){};</script> An anonymous function expression as the whole expression in an expression statement was allowed in the ancient days, in particular for the eval use-case, and people came to count on it. Other browsers even cloned this extension. We dropped support by enabling JSOPTION_ANONFUNFIX with bug 377433. Setting this in the shell will require testsuite and fuzzer adjustments. /be
Not taking assignment but I'll help if someone cc'ed can -- anyone? /be
jsfunfuzz currently calls 'options("anonfunfix");' whenever it detects that it's in a Spidermonkey shell. Depending on the fix here, this might need to be changed.
Assignee: general → brendan
Status: NEW → ASSIGNED
Need someone with fresh eyes to plug-n-chug per the ASI rules. /be
Attachment #481231 - Flags: review?(cdleary)
Comment on attachment 481231 [details] [diff] [review] fix (mostly trace-tests) Looks like the only interesting one is that last PIC test. (Which has \r\n line endings, blech!) -s = [function() function() function() function() function() function() {}] -[function() function() function() function() {}] -function() { [function() function() {}] } -function() {} +s = [function() function() function() function() function() function() {}]; +[function() function() function() function() {}]; +(function() { [function() function() {}] }); +(function() {}); That one is actually different by ASI rules, since the second brackety deal will index into the first in the original, producing s as a result. ASI would occur before the third and fourth lines in the original.
Attachment #481231 - Flags: review?(cdleary) → review+
Whiteboard: fixed-in-tracemonkey
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: