зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1338417. Make @@iterator properties on DOM prototypes not enumerable, to match IDL spec. r=qdot
This commit is contained in:
Родитель
0cb08702ba
Коммит
e1a9c1904b
|
@ -2389,7 +2389,7 @@ class MethodDefiner(PropertyDefiner):
|
|||
"methodInfo": False,
|
||||
"selfHostedName": "ArrayValues",
|
||||
"length": 0,
|
||||
"flags": "JSPROP_ENUMERATE",
|
||||
"flags": "0", # Not enumerable, per spec.
|
||||
"condition": MemberCondition()
|
||||
})
|
||||
|
||||
|
@ -3073,25 +3073,28 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
|
|||
symbolJSID=symbolJSID))
|
||||
defineFn = "JS_DefinePropertyById"
|
||||
prop = "iteratorId"
|
||||
enumFlags = "0" # Not enumerable, per spec.
|
||||
elif alias.startswith("@@"):
|
||||
raise TypeError("Can't handle any well-known Symbol other than @@iterator")
|
||||
else:
|
||||
getSymbolJSID = None
|
||||
defineFn = "JS_DefineProperty"
|
||||
prop = '"%s"' % alias
|
||||
return CGList([
|
||||
getSymbolJSID,
|
||||
# XXX If we ever create non-enumerable properties that can
|
||||
# be aliased, we should consider making the aliases
|
||||
# match the enumerability of the property being aliased.
|
||||
enumFlags = "JSPROP_ENUMERATE"
|
||||
return CGList([
|
||||
getSymbolJSID,
|
||||
CGGeneric(fill(
|
||||
"""
|
||||
if (!${defineFn}(aCx, proto, ${prop}, aliasedVal, JSPROP_ENUMERATE)) {
|
||||
if (!${defineFn}(aCx, proto, ${prop}, aliasedVal, ${enumFlags})) {
|
||||
$*{failureCode}
|
||||
}
|
||||
""",
|
||||
defineFn=defineFn,
|
||||
prop=prop,
|
||||
enumFlags=enumFlags,
|
||||
failureCode=failureCode))
|
||||
], "\n")
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче