Open Bug 638577 Opened 13 years ago Updated 12 hours ago

Reflect.parse doesn't handle doubly-declared functions gracefully

Categories

(Core :: JavaScript Engine, defect)

Other Branch
defect

Tracking

()

ASSIGNED

People

(Reporter: jorendorff, Assigned: bthrall)

Details

Attachments

(1 file)

Possibly a duplicate of bug 632030.

var a = Reflect.parse(
            "function f() { return 1; } function f() { return 2; }",
            {loc: false});
a.body[0].toSource() === a.body[1].toSource()   // true

No matter what's in the two function bodies, we get the same FunctionDeclaration twice.

This quirk never causes Reflect.parse to return a "wrong" AST in the sense of having different program behavior, but it's odd enough that it breaks a test (see patch in bug 630232).
Assignee: general → nobody
Severity: normal → S3

The test commented out in bug 630232 now passes.

Bug 591450 is closed but failed to uncomment its test, so I'm uncommenting it
here.

Assignee: nobody → bthrall
Status: NEW → ASSIGNED
Pushed by bthrall@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/877508168f75
Restore commented out tests r=nbp
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: