Closed
Bug 595555
Opened 15 years ago
Closed 15 years ago
JSOPTION_ANONFUNFIX should be set in js shell
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla2.0
People
(Reporter: brendan, Assigned: brendan)
References
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file)
|
9.12 KB,
patch
|
cdleary
:
review+
|
Details | Diff | Splinter Review |
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
| Assignee | ||
Comment 1•15 years ago
|
||
Not taking assignment but I'll help if someone cc'ed can -- anyone?
/be
Comment 2•15 years ago
|
||
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 | ||
Updated•15 years ago
|
Assignee: general → brendan
Status: NEW → ASSIGNED
| Assignee | ||
Comment 3•15 years ago
|
||
Need someone with fresh eyes to plug-n-chug per the ASI rules.
/be
Attachment #481231 -
Flags: review?(cdleary)
Comment 4•15 years ago
|
||
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+
| Assignee | ||
Comment 5•15 years ago
|
||
Whiteboard: fixed-in-tracemonkey
| Assignee | ||
Comment 6•15 years ago
|
||
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.
Description
•