Closed
Bug 246911
Opened 20 years ago
Closed 20 years ago
misbehave of switch() statement with variable as label
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: thingol, Assigned: shaver)
Details
(Keywords: verified1.7, Whiteboard: fixed-aviary1.0)
Attachments
(3 files)
162 bytes,
text/html; charset=us-ascii
|
Details | |
823 bytes,
patch
|
brendan
:
review+
brendan
:
approval1.7+
|
Details | Diff | Splinter Review |
2.21 KB,
text/plain
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040206 Firefox/0.8 Build Identifier: Firefox/0.9 This code: var a = 10; a = 9; var b = 10; switch(b) { case a: alert('got it'); break; default: alert('passed'); } give 'passed' in all browsers including MSIE & FireFox 0.8, but gives 'got it' under FireFox 0.9. As it seems to me, it's a bug. Reproducible: Always Steps to Reproduce: 1. Write your code with switch() statement using variables as labels. Actual Results: Variable are always constant in switch() statement. Expected Results: Variable must change its value when I change it.
Comment 2•20 years ago
|
||
Something bad in the browser embeddings. We can't reproduce this in the shells, AFAIK. /be
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 3•20 years ago
|
||
Hmm, trunk builds pass too, is this aviary branch only?
Comment 4•20 years ago
|
||
Hmm, if I copy the JS engine source into my aviary branch tree and rebuild, the bug goes away. Did something get fixed on the trunk and not on the aviary branch, or was something incorrectly merged?
Comment 5•20 years ago
|
||
Here are the 1.7 bugs that were merged into the aviary branch: http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=MozillaTinderboxAll&branch=AVIARY_1_0_20040515_BRANCH&branchtype=match&dir=mozilla%2Fjs&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=month&mindate=&maxdate=&cvsroot=%2Fcvsroot I'd look here first as this is one patch I had to apply by hand: Bug #245795
Comment 6•20 years ago
|
||
This happens on the 1.7 branch as well, so unlikely a aviary branch merge problem.
Assignee | ||
Comment 8•20 years ago
|
||
Looking for quick r/sr for "obvious" fix. Risk very limited: might cause us to miss a chance to optimize a constant, at absolute worst.
Comment 9•20 years ago
|
||
Comment on attachment 150869 [details] [diff] [review] only define compile-time constants for JSOP_DEFCONST Curse me for sneaking a fix into a big landing. I had completely forgotten about this! /be
Attachment #150869 -
Flags: review+
Attachment #150869 -
Flags: approval1.7+
Comment 10•20 years ago
|
||
In case it's unclear, this fix has been on the trunk a while. It's good for the aviary branch too; I think Ben is syncing up. Someone slap the right keywords or status whiteboard on this bug and resolve it. /be
Comment 11•20 years ago
|
||
looks like this has been checked in to 1.7 and aviary now, so slapping as requested.
Status: NEW → RESOLVED
Closed: 20 years ago
Keywords: fixed1.7
Resolution: --- → FIXED
Whiteboard: fixed-aviary1.0
Version: Trunk → Other Branch
Assignee | ||
Comment 12•20 years ago
|
||
We need a test case for this in the suite, I beseech thee!
Comment 13•20 years ago
|
||
using the reporters test case with 1.7, this is verified.
Status: RESOLVED → VERIFIED
Updated•20 years ago
|
Keywords: fixed1.7 → verified1.7
Comment 14•19 years ago
|
||
Roman, with your permission this will be included in the javascript test library.
Reporter | ||
Comment 15•19 years ago
|
||
> Roman, with your permission this will be included in the javascript test
> library.
Yes, of course.
Thank you very much.
Comment 16•19 years ago
|
||
js1_5/Regress/regress-246911.js checked in.
Updated•19 years ago
|
Flags: testcase+
You need to log in
before you can comment on or make changes to this bug.
Description
•