Decompiler can't make up its mind about whether if(lambda) needs extra parens

VERIFIED FIXED in mozilla1.8.1

Status

()

Core
JavaScript Engine
P1
minor
VERIFIED FIXED
12 years ago
12 years ago

People

(Reporter: Jesse Ruderman, Assigned: brendan)

Tracking

(Blocks: 1 bug, {testcase, verified1.8.1})

Trunk
mozilla1.8.1
testcase, verified1.8.1
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

12 years ago
js> function () {
    if (function () {}) {
        g();
    }
}
function () {
    if ((function () {})) {
        g();
    }
}

js> function () {
    if ((function () {})) {
        g();
    }
}
function () {
    if (function () {}) {
        g();
    }
}
(Assignee)

Comment 1

12 years ago
More fallout from the generally righteous patch for bug 350531.

/be
Assignee: general → brendan
Depends on: 350531
OS: Mac OS X 10.4 → All
Priority: -- → P1
Hardware: Macintosh → All
Target Milestone: --- → mozilla1.8.1
(Assignee)

Comment 2

12 years ago
Created attachment 237080 [details] [diff] [review]
fix

Again the thrust of the fix is to take advantage of the fix for bug 350531 and avoid forcing parentheses, instead letting the opcode precedence levels and the postfix-to-infix parenthesization magic in PopOff do their thing.  This requires making the lambda bytecodes have a lower precedence than the member operators.

/be
Attachment #237080 - Flags: review?(mrbkap)

Updated

12 years ago
Attachment #237080 - Flags: review?(mrbkap) → review+
(Assignee)

Comment 3

12 years ago
Fixed on trunk and 1.8 branch (force majeure again, last time if I can help it).

/be
Status: NEW → RESOLVED
Last Resolved: 12 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED

Comment 4

12 years ago
Checking in regress-351626.js;
/cvsroot/mozilla/js/tests/js1_5/Regress/regress-351626.js,v  <--  regress-351626.js
initial revision: 1.1
Flags: in-testsuite+
Summary: Decompiler can't make up its mind about whether if(lambda) needs extra parens → deDecompiler can't make up its mind about whether if(lambda) needs extra parens

Updated

12 years ago
Summary: deDecompiler can't make up its mind about whether if(lambda) needs extra parens → Decompiler can't make up its mind about whether if(lambda) needs extra parens

Comment 5

12 years ago
verified fixed 1.8 1.9 20060909 windows/mac*/linux
Status: RESOLVED → VERIFIED
Keywords: fixed1.8.1 → verified1.8.1
You need to log in before you can comment on or make changes to this bug.