Index: Source/bindings/templates/methods.cpp |
diff --git a/Source/bindings/templates/methods.cpp b/Source/bindings/templates/methods.cpp |
index 5f7f0bb8d783867550a371075da1ce216a8dc010..5051f7283e13f8e5150d0c8e74a7df2149c747a9 100644 |
--- a/Source/bindings/templates/methods.cpp |
+++ b/Source/bindings/templates/methods.cpp |
@@ -197,10 +197,17 @@ if (!({{argument.enum_validation_expression}})) { |
(argument.index + 1)) | indent}} |
return; |
} |
-{% elif argument.idl_type in ['Dictionary', 'Promise'] %} |
+{% elif argument.is_dictionary or argument.idl_type == 'Dictionary' %} |
Jens Widell
2014/09/12 09:13:53
It would make sense to have this check before we c
bashi
2014/09/12 10:00:49
Done, and now I can change if -> ASSERT() in toImp
|
{# Dictionaries must have type Undefined, Null or Object: |
http://heycam.github.io/webidl/#es-dictionary |
-We also require this for our implementation of promises, though not in spec: |
+FIXME: Remove generic 'Dictionary' special-casing. #} |
+if (!isUndefinedOrNull(info[{{argument.index}}]) && !info[{{argument.index}}]->IsObject()) { |
+ {{throw_type_error(method, '"parameter %s (\'%s\') is not an object."' % |
+ (argument.index + 1, argument.name)) | indent}} |
+ return; |
+} |
+{% elif argument.idl_type == 'Promise' %} |
+{# We also require this for our implementation of promises, though not in spec: |
http://heycam.github.io/webidl/#es-promise #} |
if (!{{argument.name}}.isUndefinedOrNull() && !{{argument.name}}.isObject()) { |
{{throw_type_error(method, '"parameter %s (\'%s\') is not an object."' % |