mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Implement [LenientThis] support and enable it in Document.webidl
Closes issue #3760
This commit is contained in:
parent
0c12f630e6
commit
e023662571
2 changed files with 8 additions and 8 deletions
|
@ -2526,9 +2526,9 @@ class CGGenericGetter(CGAbstractBindingMethod):
|
||||||
if lenientThis:
|
if lenientThis:
|
||||||
name = "genericLenientGetter"
|
name = "genericLenientGetter"
|
||||||
unwrapFailureCode = (
|
unwrapFailureCode = (
|
||||||
"MOZ_ASSERT(!JS_IsExceptionPending(cx));\n"
|
"assert!(JS_IsExceptionPending(cx) == 0);\n"
|
||||||
"JS_SET_RVAL(cx, vp, JS::UndefinedValue());\n"
|
"*vp = UndefinedValue();\n"
|
||||||
"return true;")
|
"return 1;")
|
||||||
else:
|
else:
|
||||||
name = "genericGetter"
|
name = "genericGetter"
|
||||||
unwrapFailureCode = None
|
unwrapFailureCode = None
|
||||||
|
@ -2600,8 +2600,8 @@ class CGGenericSetter(CGAbstractBindingMethod):
|
||||||
if lenientThis:
|
if lenientThis:
|
||||||
name = "genericLenientSetter"
|
name = "genericLenientSetter"
|
||||||
unwrapFailureCode = (
|
unwrapFailureCode = (
|
||||||
"MOZ_ASSERT(!JS_IsExceptionPending(cx));\n"
|
"assert!(JS_IsExceptionPending(cx) == 0);\n"
|
||||||
"return true;")
|
"return 1;")
|
||||||
else:
|
else:
|
||||||
name = "genericSetter"
|
name = "genericSetter"
|
||||||
unwrapFailureCode = None
|
unwrapFailureCode = None
|
||||||
|
@ -4136,11 +4136,11 @@ class CGDescriptor(CGThing):
|
||||||
if hasGetter:
|
if hasGetter:
|
||||||
cgThings.append(CGGenericGetter(descriptor))
|
cgThings.append(CGGenericGetter(descriptor))
|
||||||
if hasLenientGetter:
|
if hasLenientGetter:
|
||||||
pass
|
cgThings.append(CGGenericGetter(descriptor, lenientThis=True))
|
||||||
if hasSetter:
|
if hasSetter:
|
||||||
cgThings.append(CGGenericSetter(descriptor))
|
cgThings.append(CGGenericSetter(descriptor))
|
||||||
if hasLenientSetter:
|
if hasLenientSetter:
|
||||||
pass
|
cgThings.append(CGGenericSetter(descriptor, lenientThis=True))
|
||||||
|
|
||||||
if descriptor.concrete:
|
if descriptor.concrete:
|
||||||
cgThings.append(CGClassFinalizeHook(descriptor))
|
cgThings.append(CGClassFinalizeHook(descriptor))
|
||||||
|
|
|
@ -79,6 +79,6 @@ partial interface Document {
|
||||||
NodeList getElementsByName(DOMString elementName);
|
NodeList getElementsByName(DOMString elementName);
|
||||||
|
|
||||||
// special event handler IDL attributes that only apply to Document objects
|
// special event handler IDL attributes that only apply to Document objects
|
||||||
/*[LenientThis]*/ attribute EventHandler onreadystatechange;
|
[LenientThis] attribute EventHandler onreadystatechange;
|
||||||
};
|
};
|
||||||
Document implements GlobalEventHandlers;
|
Document implements GlobalEventHandlers;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue