aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/CodegenRust.py
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2017-01-03 17:44:55 -0800
committerEric Anholt <eric@anholt.net>2017-01-04 18:02:30 -0800
commitaf380c27175270c741cc4e267bb0da3b50994e8b (patch)
tree7c9cea0e7261a93122b665c1bf86ce4928e18cf6 /components/script/dom/bindings/codegen/CodegenRust.py
parentd90499ab358d54743482bad2370bee8334ea59b0 (diff)
downloadservo-af380c27175270c741cc4e267bb0da3b50994e8b.tar.gz
servo-af380c27175270c741cc4e267bb0da3b50994e8b.zip
Fix JS_ObjectIsDate() call in webidl codegen.
We were missing the import, and the prototype of the function has since changed. Partial fix for #10675
Diffstat (limited to 'components/script/dom/bindings/codegen/CodegenRust.py')
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index 21573cf4bea..19d279cc71e 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -467,7 +467,11 @@ class CGMethodCall(CGThing):
# Check for Date objects
# XXXbz Do we need to worry about security wrappers around the Date?
- pickFirstSignature("%s.get().is_object() && JS_ObjectIsDate(cx, &%s.get().to_object())" %
+ pickFirstSignature("%s.get().is_object() && "
+ "{ rooted!(in(cx) let obj = %s.get().to_object()); "
+ "let mut is_date = false; "
+ "assert!(JS_ObjectIsDate(cx, obj.handle(), &mut is_date)); "
+ "is_date }" %
(distinguishingArg, distinguishingArg),
lambda s: (s[1][distinguishingIndex].type.isDate() or
s[1][distinguishingIndex].type.isObject()))
@@ -5468,6 +5472,7 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries
'js::jsapi::JS_NewObject',
'js::jsapi::JS_NewObjectWithGivenProto',
'js::jsapi::JS_NewObjectWithoutMetadata',
+ 'js::jsapi::JS_ObjectIsDate',
'js::jsapi::JS_SetImmutablePrototype',
'js::jsapi::JS_SetProperty',
'js::jsapi::JS_SetReservedSlot',