Closed Bug 402386 Opened 17 years ago Closed 17 years ago

incorrect automatic semicolon insertion after (x\n)++/--

Categories

(Core :: JavaScript Engine, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla1.9beta1

People

(Reporter: brendan, Assigned: brendan)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch fix (obsolete) (deleted) — 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)
Status: NEW → ASSIGNED
Priority: -- → P2
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
Attached patch the right fix (deleted) — Splinter Review
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)
Attachment #287274 - Flags: review?(mrbkap) → review+
Attachment #287274 - Flags: approval1.9?
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+
(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.
Fixed: js/src/jsparse.c 3.307 /be
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
/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-
verified fixed 1.9.0 linux|mac|win
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: