Reflect.parse("x.*") shouldn't mark the MemberExpression as computed

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: jorendorff, Assigned: jorendorff)

Tracking

Other Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [fixed-in-tracemonkey])

Attachments

(1 attachment)

(Assignee)

Description

7 years ago
Reflect.parse("x.*") is the same as Reflect.parse("x[*]").
This is a bug because they're two different programs.

  js> x = <x/>;
  <x/>
  js> x.*
                                     <-- empty XMLList
  js> x[*]
  typein:10: ReferenceError: reference to undefined XML name *::*

Both ASTs contain a node with {type: "MemberExpression", computed: true}.
The first one should have computed: false.

Something similar goes for @x and @[x].
(Assignee)

Comment 1

7 years ago
Created attachment 508425 [details] [diff] [review]
v1

This adds a .computed property to XMLAttributeSelector nodes.

(I ran across this bug while trying to test some Reflect.stringify code; see bug 590755.)
Assignee: general → jorendorff
Attachment #508425 - Flags: review?(dherman)
Comment on attachment 508425 [details] [diff] [review]
v1

Good catch, thanks. r=me

Dave
Attachment #508425 - Flags: review?(dherman) → review+
(Assignee)

Comment 3

7 years ago
http://hg.mozilla.org/tracemonkey/rev/923b87e79ef9
Whiteboard: [fixed-in-tracemonkey]
http://hg.mozilla.org/mozilla-central/rev/923b87e79ef9
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.