aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/CodegenRust.py
diff options
context:
space:
mode:
authorMukilan Thiyagarajan <mukilanthiagarajan@gmail.com>2014-10-25 12:05:36 +0530
committerMukilan Thiyagarajan <mukilanthiagarajan@gmail.com>2014-10-25 12:05:36 +0530
commite0236625712f96c539f04a24b7e6b2efef2f1929 (patch)
tree897518d5146acf06a1fe43a897bb0311fa1c8be7 /components/script/dom/bindings/codegen/CodegenRust.py
parent0c12f630e6352fc2aa00b638d014b2505f68af1f (diff)
downloadservo-e0236625712f96c539f04a24b7e6b2efef2f1929.tar.gz
servo-e0236625712f96c539f04a24b7e6b2efef2f1929.zip
Implement [LenientThis] support and enable it in Document.webidl
Closes issue #3760
Diffstat (limited to 'components/script/dom/bindings/codegen/CodegenRust.py')
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index a6e4fcd6ebc..883b7448d61 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -2526,9 +2526,9 @@ class CGGenericGetter(CGAbstractBindingMethod):
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
@@ -2600,8 +2600,8 @@ class CGGenericSetter(CGAbstractBindingMethod):
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
@@ -4136,11 +4136,11 @@ class CGDescriptor(CGThing):
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))