Closed Bug 375882 Opened 18 years ago Closed 18 years ago

Decompiler still outputs "NaN" (etc) incorrectly for |case|

Categories

(Core :: JavaScript Engine, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla1.9alpha4

People

(Reporter: jruderman, Assigned: brendan)

References

Details

(Keywords: testcase)

Attachments

(1 file, 2 obsolete files)

Bug 351219 didn't fix switch |case| decompilation: js> function() { switch(a) { case 0/0: a; case 1/0: b; case -1/0: c; case -0: d; } } function () { switch (a) { case NaN: a; case Infinity: b; case -Infinity: c; case 0: d; default:; } }
Attached patch fix (obsolete) — Splinter Review
Assignee: general → brendan
Status: NEW → ASSIGNED
Attachment #260198 - Flags: review?(mrbkap)
OS: Mac OS X → All
Priority: -- → P2
Hardware: PC → All
Target Milestone: --- → mozilla1.9alpha4
Attached patch fix, v2 (obsolete) — Splinter Review
Forgot static, and added an assertion. /be
Attachment #260198 - Attachment is obsolete: true
Attachment #260199 - Flags: review?(mrbkap)
Attachment #260198 - Flags: review?(mrbkap)
Attachment #260199 - Flags: review?(mrbkap) → review+
Attached patch patch to commitSplinter Review
Use ?: in JSOP_NUMBER's decompiler instead of if/else with common left-hand side (todo) of single assignment statement in then and else clauses. Bonus: no Sprint* function calls have to wrap unnaturally given the wrapped ?:. /be
Attachment #260199 - Attachment is obsolete: true
Attachment #260307 - Flags: review+
Fixed on trunk: js/src/jsopcode.c 3.222 /be
Blocks: js1.7src
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
/cvsroot/mozilla/js/tests/js1_5/decompilation/regress-375882.js,v <-- regress-375882.js initial revision: 1.1 the case 1 / -0 : just looks weird to me. function ( ) { switch ( a ) { case 0 / 0 : a ; case 1 / 0 : b ; case 1 / - 0 : c ; case - 0 : d ; default : ; } }
Flags: in-testsuite+
We could use -1 / 0 since the expression will be auto-parenthesized as needed, based on operator precedence. File a new bug for this prettier form if you like? /be
verified fixed linux, windows, mac* shell 20070406
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: