Open Bug 1321738 Opened 8 years ago Updated 2 years ago

Xrays don't expose some symbol-named props when asking for the list of an object's properties

Categories

(Core :: DOM: Bindings (WebIDL), defect, P3)

defect

Tracking

()

Tracking Status
firefox53 --- affected

People

(Reporter: bzbarsky, Unassigned)

References

(Blocks 1 open bug)

Details

Simple testcase: in a chrome scratchpad targeting a non-e10s window, evaluate:

  Object.getOwnPropertySymbols(content.Node).map(String)

and compare it to:

  Object.getOwnPropertySymbols(content.Node.wrappedJSObject).map(String)

Note that the latter includes "Symbol(Symbol.hasInstance)" and the former does not.  At the same time,

  content.Node[Symbol.hasInstance]

returns a function.  The problem is that XrayOwnPropertyKeys didn't get updated when we added some symbol-named stuff to Xrays...

Note that we _do_ seem to get this right for @@iterator:

  Object.getOwnPropertySymbols(content.HTMLCollection.prototype).map(String)

shows it.  Presumably because that's actually in our property arrays?

So it's possible this is limited to @@hasInstance on interface objects and @@unscopables on some prototype objects.  Those are the two things we define by hand with symbol names.  And I guess we don't expose @@unscopables over Xrays at all.
Priority: -- → P3
Component: DOM → DOM: Core & HTML
Mentor: bzbarsky
Component: DOM: Core & HTML → DOM: Bindings (WebIDL)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.