All users were logged out of Bugzilla on October 13th, 2018

Decompilation of "case (yield):" does not compile

VERIFIED FIXED in mozilla1.9alpha4

Status

()

P2
normal
VERIFIED FIXED
12 years ago
12 years ago

People

(Reporter: jruderman, Assigned: brendan)

Tracking

(Blocks: 1 bug, {testcase})

Trunk
mozilla1.9alpha4
testcase
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

12 years ago
js> function() { switch (x) { case (yield): } }
function () {
    switch (x) {
      case yield:
      default:;
    }
}

js> function () { switch (x) { case yield: } }
syntax error
(Reporter)

Comment 1

12 years ago
Is this a bug in the decompiler or a bug in the compiler?

Why is "case yield:" a syntax error while "case yield 5:" is accepted?
(Assignee)

Comment 2

12 years ago
I think case yield: should not be an error.  The E262-3 grammar says a case label is an Expression (Expr in jsparse.c terms).  There's no problem with , as in an argument list.  Comments?

/be
(Reporter)

Comment 3

12 years ago
js> new Function("switch(w) { case yield\n: x }")

somehow compiles, but its decompilation of course doesn't compile.
(Reporter)

Comment 4

12 years ago
WFM: "case yield:" is now accepted.
Status: NEW → RESOLVED
Last Resolved: 12 years ago
Flags: in-testsuite?
Resolution: --- → WORKSFORME
(Reporter)

Comment 5

12 years ago
D'oh, I was testing without "-v 170".
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
(Assignee)

Comment 6

12 years ago
Created attachment 260561 [details] [diff] [review]
fix
Assignee: general → brendan
Status: REOPENED → ASSIGNED
Attachment #260561 - Flags: review?(mrbkap)
(Assignee)

Updated

12 years ago
OS: Mac OS X → All
Priority: -- → P2
Hardware: Macintosh → All
Target Milestone: --- → mozilla1.9alpha4
Attachment #260561 - Flags: review?(mrbkap) → review+
(Assignee)

Comment 7

12 years ago
Fixed on trunk:

js/src/jsparse.c 3.275

/be
Blocks: 355044
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago12 years ago
Resolution: --- → FIXED

Comment 8

12 years ago
/cvsroot/mozilla/js/tests/js1_7/decompilation/regress-352441.js,v  <--  regress-352441.js
initial revision: 1.1
Flags: in-testsuite? → in-testsuite+

Comment 9

12 years ago
verified fixed on trunk.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.