Remove hasInstance class hooks.
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox100 | --- | fixed |
People
(Reporter: mrrrgn, Assigned: jandem)
References
(Blocks 1 open bug)
Details
Attachments
(5 files)
No description provided.
Comment 1•9 years ago
|
||
evilpie asked about the DOM. As I understand it, we'd just need to replace the current hasInstance class hooks on the DOM classes with JSNatives implementing the same logic that are defined as a property on the relevant constructor objects, right?
Comment 2•9 years ago
|
||
yup
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 3•3 years ago
|
||
We can instead rely on the default behavior for instanceof
in JS::OrdinaryHasInstance
.
This works because these objects are callable (since the JSClass has a call-hook) and
they have a .prototype
property that returns the value in the proto slot.
Assignee | ||
Comment 4•3 years ago
|
||
Depends on D141342
Assignee | ||
Comment 5•3 years ago
|
||
Resolve a Symbol.hasInstance
native function that works like the class hook.
Depends on D141343
Assignee | ||
Comment 6•3 years ago
|
||
This can be changed more later on, but for now this ensures no change in behavior.
Depends on D141344
Assignee | ||
Comment 7•3 years ago
|
||
Code should use Symbol.hasInstance
to customize instanceof
behavior.
Depends on D141345
Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/910c5efb495b part 1 - Remove hasInstance hook from CType objects. r=iain https://hg.mozilla.org/integration/autoland/rev/261afd35a438 part 2 - Add AutoSetResolvingWrapper helper RAII class. r=mccr8 https://hg.mozilla.org/integration/autoland/rev/18c2025ccfab part 3 - Replace hasInstance JSClass hook on wrapped natives with a Symbol.hasInstance native. r=peterv https://hg.mozilla.org/integration/autoland/rev/31122b75a592 part 4 - Inline Proxy::hasInstance call instead of using a class hook. r=iain https://hg.mozilla.org/integration/autoland/rev/cb11b00621a2 part 5 - Remove hasInstance class hook. r=iain
Comment 10•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/910c5efb495b
https://hg.mozilla.org/mozilla-central/rev/261afd35a438
https://hg.mozilla.org/mozilla-central/rev/18c2025ccfab
https://hg.mozilla.org/mozilla-central/rev/31122b75a592
https://hg.mozilla.org/mozilla-central/rev/cb11b00621a2
Description
•