aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/CodegenRust.py
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-03-04 15:14:20 +0530
committerbors-servo <lbergstrom+bors@mozilla.com>2016-03-04 15:14:20 +0530
commitc37a0866608421d9e3afd67f0777e27091104f0f (patch)
treef72c7237b7ffb7441b286d84b03311693ed0ea83 /components/script/dom/bindings/codegen/CodegenRust.py
parent12466b87062d8a20bd134bdd5824d46c5216ee48 (diff)
parent3e78b54d46fba83e2233e7087c196ee5097c320e (diff)
downloadservo-c37a0866608421d9e3afd67f0777e27091104f0f.tar.gz
servo-c37a0866608421d9e3afd67f0777e27091104f0f.zip
Auto merge of #9786 - peterjoel:fix_codegen_is_array_like, r=jdm
Fixed compile error in generated code, when webidl constructors have same number of args One of the ways that generated code differentiates constructors is by comparing if the args are array-like. The generated code was calling a function `IsArrayLike` that no longer exists. I re-implemented it with a more rust-like naming scheme. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9786) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/bindings/codegen/CodegenRust.py')
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index 56144485ab6..4468bb13b6b 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -433,7 +433,7 @@ class CGMethodCall(CGThing):
# XXXbz Now we're supposed to check for distinguishingArg being
# an array or a platform object that supports indexed
# properties... skip that last for now. It's a bit of a pain.
- pickFirstSignature("%s.get().isObject() && IsArrayLike(cx, &%s.get().toObject())" %
+ pickFirstSignature("%s.get().is_object() && is_array_like(cx, %s)" %
(distinguishingArg, distinguishingArg),
lambda s:
(s[1][distinguishingIndex].type.isArray() or
@@ -442,7 +442,7 @@ class CGMethodCall(CGThing):
# Check for Date objects
# XXXbz Do we need to worry about security wrappers around the Date?
- pickFirstSignature("%s.get().isObject() && JS_ObjectIsDate(cx, &%s.get().toObject())" %
+ pickFirstSignature("%s.get().is_object() && JS_ObjectIsDate(cx, &%s.get().to_object())" %
(distinguishingArg, distinguishingArg),
lambda s: (s[1][distinguishingIndex].type.isDate() or
s[1][distinguishingIndex].type.isObject()))
@@ -5438,7 +5438,8 @@ class CGBindingRoot(CGThing):
'dom::bindings::callback::{CallbackContainer,CallbackInterface,CallbackFunction}',
'dom::bindings::callback::{CallSetup,ExceptionHandling}',
'dom::bindings::callback::wrap_call_this_object',
- 'dom::bindings::conversions::{ConversionBehavior, DOM_OBJECT_SLOT, IDLInterface}',
+ 'dom::bindings::conversions::{ConversionBehavior, DOM_OBJECT_SLOT}',
+ 'dom::bindings::conversions::{IDLInterface, is_array_like}',
'dom::bindings::conversions::{FromJSValConvertible, StringificationBehavior}',
'dom::bindings::conversions::{ToJSValConvertible, jsid_to_str, native_from_handlevalue}',
'dom::bindings::conversions::{native_from_object, private_from_object, root_from_object}',