servo / servo

Servo, the embeddable, independent, memory-safe, modular, parallel web rendering engine
https://servo.org
Mozilla Public License 2.0
28.49k stars 3.04k forks source link

The object Element.prototype[Symbol.unscopables] itself has a prototype but shouldn't #25022

Open pshaughn opened 4 years ago

pshaughn commented 4 years ago

WPT WebIDL/emcascript-binding/interface-prototype-object.html tests this and fails; other browsers pass.

pshaughn commented 4 years ago

https://heycam.github.io/webidl/#interface-prototype-object 8.1 tells us to create this object with a null prototype. interface.rs create_unscopable_object calls JS_NewPlainObject, which is the wrong constructor: it's creating a "plain" object in the sense that {} is a plain object, having the default Object.prototype rather than the unusual special case of a completely absent prototype. I'll see if JS_NewObject(*cx, ptr::null()), as seen in create_callback_interface_object, has the desired result.

Update: No, it did not.