mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-04 22:37:29 +09:00
1333045 - Update Location object properties to current spec.
Specifically, three changes: 1) valueOf should be non-enumerable. 2) valueOf should be === to Object.prototype.valueOf. 3) There should be no toJSON.
This commit is contained in:
parent
337cdbd0ce
commit
1af9026a89
9 changed files with 72 additions and 24 deletions
|
|
@ -2390,11 +2390,10 @@ class MethodDefiner(PropertyDefiner):
|
|||
# Synthesize our valueOf method
|
||||
self.regular.append({
|
||||
"name": 'valueOf',
|
||||
"nativeName": "UnforgeableValueOf",
|
||||
"selfHostedName": "Object_valueOf",
|
||||
"methodInfo": False,
|
||||
"length": 0,
|
||||
"flags": "JSPROP_ENUMERATE", # readonly/permanent added
|
||||
# automatically.
|
||||
"flags": "0", # readonly/permanent added automatically.
|
||||
"condition": MemberCondition()
|
||||
})
|
||||
|
||||
|
|
@ -3456,19 +3455,15 @@ def InitUnforgeablePropertiesOnHolder(descriptor, properties, failureCode,
|
|||
"nsContentUtils::ThreadsafeIsCallerChrome()"))
|
||||
|
||||
if descriptor.interface.getExtendedAttribute("Unforgeable"):
|
||||
# We do our undefined toJSON and toPrimitive here, not as a regular
|
||||
# property because we don't have a concept of value props anywhere in
|
||||
# IDL.
|
||||
# We do our undefined toPrimitive here, not as a regular property
|
||||
# because we don't have a concept of value props anywhere in IDL.
|
||||
unforgeables.append(CGGeneric(fill(
|
||||
"""
|
||||
JS::RootedId toPrimitive(aCx,
|
||||
SYMBOL_TO_JSID(JS::GetWellKnownSymbol(aCx, JS::SymbolCode::toPrimitive)));
|
||||
if (!JS_DefinePropertyById(aCx, ${holderName}, toPrimitive,
|
||||
JS::UndefinedHandleValue,
|
||||
JSPROP_READONLY | JSPROP_PERMANENT) ||
|
||||
!JS_DefineProperty(aCx, ${holderName}, "toJSON",
|
||||
JS::UndefinedHandleValue,
|
||||
JSPROP_READONLY | JSPROP_ENUMERATE | JSPROP_PERMANENT)) {
|
||||
JSPROP_READONLY | JSPROP_PERMANENT)) {
|
||||
$*{failureCode}
|
||||
}
|
||||
""",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue