Skip to content

Commit

Permalink
Implement [LenientThis] support and enable it in Document.webidl
Browse files Browse the repository at this point in the history
Closes issue #3760
  • Loading branch information
mukilan committed Oct 25, 2014
1 parent 0c12f63 commit e023662
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions components/script/dom/bindings/codegen/CodegenRust.py
Expand Up @@ -2526,9 +2526,9 @@ def __init__(self, descriptor, lenientThis=False):
if lenientThis:
name = "genericLenientGetter"
unwrapFailureCode = (
"MOZ_ASSERT(!JS_IsExceptionPending(cx));\n"
"JS_SET_RVAL(cx, vp, JS::UndefinedValue());\n"
"return true;")
"assert!(JS_IsExceptionPending(cx) == 0);\n"
"*vp = UndefinedValue();\n"
"return 1;")
else:
name = "genericGetter"
unwrapFailureCode = None
Expand Down Expand Up @@ -2600,8 +2600,8 @@ def __init__(self, descriptor, lenientThis=False):
if lenientThis:
name = "genericLenientSetter"
unwrapFailureCode = (
"MOZ_ASSERT(!JS_IsExceptionPending(cx));\n"
"return true;")
"assert!(JS_IsExceptionPending(cx) == 0);\n"
"return 1;")
else:
name = "genericSetter"
unwrapFailureCode = None
Expand Down Expand Up @@ -4136,11 +4136,11 @@ def __init__(self, descriptor):
if hasGetter:
cgThings.append(CGGenericGetter(descriptor))
if hasLenientGetter:
pass
cgThings.append(CGGenericGetter(descriptor, lenientThis=True))
if hasSetter:
cgThings.append(CGGenericSetter(descriptor))
if hasLenientSetter:
pass
cgThings.append(CGGenericSetter(descriptor, lenientThis=True))

if descriptor.concrete:
cgThings.append(CGClassFinalizeHook(descriptor))
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/webidls/Document.webidl
Expand Up @@ -79,6 +79,6 @@ partial interface Document {
NodeList getElementsByName(DOMString elementName);

// special event handler IDL attributes that only apply to Document objects
/*[LenientThis]*/ attribute EventHandler onreadystatechange;
[LenientThis] attribute EventHandler onreadystatechange;
};
Document implements GlobalEventHandlers;

0 comments on commit e023662

Please sign in to comment.