Closed Bug 352459 Opened 20 years ago Closed 19 years ago

Incorrect decompilation for 4..@x++

Categories

(Core :: JavaScript Engine, defect)

PowerPC
macOS
defect
Not set
minor

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jruderman, Unassigned)

Details

(Keywords: testcase)

js> function() { return 4..@x++; } function () { return 4.@x++; } The 4 wants some parens around itself.
Sorry, I have to call this minor and leave it in the general@js.bugs pile. Jeff, feel free to grab it. /be
Severity: normal → minor
This seems fixed now: js> function() { return 4..@x++; } function () { return (4).@x++; } Marking as WFM (Jeff, feel free to figure out which bug fixed this).
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → WORKSFORME
Flags: in-testsuite?
It is ok for this to convert the descendant operator ".." to property access "." ? /cvsroot/mozilla/js/tests/e4x/decompilation/regress-352459.js,v <-- regress-352459.js initial revision: 1.1
Flags: in-testsuite? → in-testsuite+
(In reply to comment #3) > It is ok for this to convert the descendant operator ".." to property access > "." ? |4..@x++| is equivalent to |(4.).@x++| which is equivalent to |(4).@x++|; the key is that 4. is a numeric literal, and since the next token isn't a number but is rather .@ the attribute access acts upon (4.). Consequently, tho it looks like it this isn't the descendant operator. Consider also |3.141592654.toPrecision(3)| or |4..toString()| for very slightly more understandable cases. I agree this isn't particularly intuitive. :-)
(In reply to comment #4) Thanks Jeff, I <3 e4x even less now if at all possible.
You need to log in before you can comment on or make changes to this bug.