Closed
Bug 402386
Opened 17 years ago
Closed 17 years ago
incorrect automatic semicolon insertion after (x\n)++/--
Categories
(Core :: JavaScript Engine, defect, P2)
Core
JavaScript Engine
Tracking
()
VERIFIED
FIXED
mozilla1.9beta1
People
(Reporter: brendan, Assigned: brendan)
References
Details
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
mrbkap
:
review+
mtschrep
:
approval1.9+
|
Details | Diff | Splinter Review |
See bug 401466. That was a Narcissus bug, different from this one, but it exposed this SpiderMonkey bug. Given x=1, y=2:
eval("(x\n)-- y")
results in 2, instead of a SyntaxError being thrown (the eval is not essential, just makes it easier to show the newline). Without eval:
js> x=1, y=2
2
js> (x
)-- y
1
Note how the ; is inserted before the --.
Without the newline:
js> (x)-- y
typein:4: SyntaxError: missing ; before statement:
typein:4: (x)-- y
typein:4: ......^
which follows the spec.
/be
Attachment #287268 -
Flags: review?(mrbkap)
Assignee | ||
Updated•17 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P2
Assignee | ||
Comment 1•17 years ago
|
||
Results with the patch:
js> x=1, y=2
2
js> (x
)-- y
typein:3: SyntaxError: missing ; before statement:
typein:3: )-- y
typein:3: ....^
/be
Assignee | ||
Comment 2•17 years ago
|
||
Shoulda thunk harder before posting that last patch.
/be
Attachment #287268 -
Attachment is obsolete: true
Attachment #287274 -
Flags: review?(mrbkap)
Attachment #287268 -
Flags: review?(mrbkap)
Updated•17 years ago
|
Attachment #287274 -
Flags: review?(mrbkap) → review+
Assignee | ||
Updated•17 years ago
|
Attachment #287274 -
Flags: approval1.9?
Comment 3•17 years ago
|
||
Comment on attachment 287274 [details] [diff] [review]
the right fix
a+ schrep - is there a regression test for this?
Attachment #287274 -
Flags: approval1.9? → approval1.9+
Comment 4•17 years ago
|
||
(In reply to comment #3)
> (From update of attachment 287274 [details] [diff] [review])
> a+ schrep - is there a regression test for this?
>
if in-testsuite+ is set, there is a test. There will be one when the bug is fixed.
Assignee | ||
Comment 5•17 years ago
|
||
Fixed:
js/src/jsparse.c 3.307
/be
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Comment 6•17 years ago
|
||
/cvsroot/mozilla/js/tests/ecma_3/LexicalConventions/7.9.1.js,v <-- 7.9.1.js
initial revision: 1.1
/cvsroot/mozilla/js/tests/ecma_3/LexicalConventions/browser.js,v <-- browser.js
initial revision: 1.1
/cvsroot/mozilla/js/tests/ecma_3/LexicalConventions/shell.js,v <-- shell.js
initial revision: 1.1
/cvsroot/mozilla/js/tests/ecma_3/extensions/7.9.1.js,v <-- 7.9.1.js
initial revision: 1.1
note the special treatment of throw in ecma_3/extensions/7.9.1.js due to bug 256617.
Flags: in-testsuite+
Flags: in-litmus-
You need to log in
before you can comment on or make changes to this bug.
Description
•