Closed Bug 1146032 Opened 11 years ago Closed 11 years ago

Parser gives wrong location for LHS pattern of list comprehension

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: billm, Assigned: billm)

Details

Attachments

(1 file)

Attached patch patchSplinter Review
If I do this: Reflect.parse("[ for (x of a) x+1 ]") Then I get a result that contains the following: type: "ComprehensionBlock", left: { loc: { start: { line: 1, column: 13 }, end: { line: 1, column: 14 }, source: null }, type: "Identifier", name: "x" }, The location information for "x" is actually the close paren. This patch fixes that.
Attachment #8581184 - Flags: review?(jwalden+bmo)
Comment on attachment 8581184 [details] [diff] [review] patch Review of attachment 8581184 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/tests/js1_8_5/extensions/reflect-parse.js @@ +1462,5 @@ > > Pattern({ source: "quad.js", start: { line: 1, column: 20 }, end: { line: 1, column: 29 } }).match(fourAC.loc); > > +var generator = Reflect.parse("[ for (x of a) x+1 ]"); > +Pattern({ start: { line: 1, column: 7 }, end: { line: 1, column: 8 } }).match(generator.body[0].expression.blocks[0].left.loc); Maybe throw in a newline or something, to make even *more* clear that the numbering is correct, by forcing the token onto a line different from where it currently is.
Attachment #8581184 - Flags: review?(jwalden+bmo) → review+
Assignee: nobody → wmccloskey
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: