mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 20:30:41 +00:00
Bug 1360715 - Part 1: Hide @@hasInstance for IDL interfaces behind a flag r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D106661
This commit is contained in:
parent
451f185db7
commit
933c060bcd
@ -837,13 +837,16 @@ static JSObject* CreateInterfaceObject(
|
||||
|
||||
if (DOMIfaceAndProtoJSClass::FromJSClass(constructorClass)
|
||||
->wantsInterfaceHasInstance) {
|
||||
JS::Rooted<jsid> hasInstanceId(cx, SYMBOL_TO_JSID(JS::GetWellKnownSymbol(
|
||||
cx, JS::SymbolCode::hasInstance)));
|
||||
if (!JS_DefineFunctionById(
|
||||
cx, constructor, hasInstanceId, InterfaceHasInstance, 1,
|
||||
// Flags match those of Function[Symbol.hasInstance]
|
||||
JSPROP_READONLY | JSPROP_PERMANENT)) {
|
||||
return nullptr;
|
||||
if (isChrome ||
|
||||
StaticPrefs::dom_webidl_crosscontext_hasinstance_enabled()) {
|
||||
JS::Rooted<jsid> hasInstanceId(cx, SYMBOL_TO_JSID(JS::GetWellKnownSymbol(
|
||||
cx, JS::SymbolCode::hasInstance)));
|
||||
if (!JS_DefineFunctionById(
|
||||
cx, constructor, hasInstanceId, InterfaceHasInstance, 1,
|
||||
// Flags match those of Function[Symbol.hasInstance]
|
||||
JSPROP_READONLY | JSPROP_PERMANENT)) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (isChrome && !JS_DefineFunction(cx, constructor, "isInstance",
|
||||
|
@ -3513,6 +3513,11 @@
|
||||
value: true
|
||||
mirror: always
|
||||
|
||||
- name: dom.webidl.crosscontext_hasinstance.enabled
|
||||
type: RelaxedAtomicBool
|
||||
value: @IS_NOT_NIGHTLY_BUILD@
|
||||
mirror: always
|
||||
|
||||
# WebShare API - exposes navigator.share()
|
||||
- name: dom.webshare.enabled
|
||||
type: bool
|
||||
|
@ -1,7 +1,2 @@
|
||||
[has-instance.html]
|
||||
[instanceof must return false across different globals, for platform objects]
|
||||
expected: FAIL
|
||||
|
||||
[platform objects do not have Symbol.hasInstance installed]
|
||||
expected: FAIL
|
||||
|
||||
prefs: [dom.webidl.crosscontext_hasinstance.enabled:false]
|
||||
|
Loading…
x
Reference in New Issue
Block a user