Index: Source/bindings/templates/methods.cpp |
diff --git a/Source/bindings/templates/methods.cpp b/Source/bindings/templates/methods.cpp |
index dfa6c1e0fb9a1dd312cbd1c378cbcee9ae3fd798..b34cd5675f9bdd1459d0d7d6dbb5828b9c57fc99 100644 |
--- a/Source/bindings/templates/methods.cpp |
+++ b/Source/bindings/templates/methods.cpp |
@@ -187,14 +187,14 @@ if (!isUndefinedOrNull(info[{{argument.index}}])) { |
{% endif %}{# argument.is_nullable #} |
{# Type checking, possibly throw a TypeError, per: |
http://www.w3.org/TR/WebIDL/#es-type-mapping #} |
-{% if argument.has_type_checking_interface and not argument.is_variadic_wrapper_type %} |
+{% if (argument.has_type_checking_interface or argument.is_small_typed_array) and not argument.is_variadic_wrapper_type %} |
{# Type checking for wrapper interface types (if interface not implemented, |
throw a TypeError), per http://www.w3.org/TR/WebIDL/#es-interface |
Note: for variadic arguments, the type checking is done for each matched |
argument instead; see argument.is_variadic_wrapper_type code-path above. #} |
-if (!{{argument.name}}{% if argument.is_nullable %} && !isUndefinedOrNull(info[{{argument.index}}]){% endif %}) { |
+if (!{{argument.name}}{%if argument.is_small_typed_array %}.first{% endif %}{% if argument.is_nullable %} && !isUndefinedOrNull(info[{{argument.index}}]){% endif %}) { |
{{throw_type_error(method, '"parameter %s is not of type \'%s\'."' % |
- (argument.index + 1, argument.idl_type)) | indent}} |
+ (argument.index + 1, argument.idl_type if not argument.is_small_typed_array else 'ArrayBufferView\' and \'small')) | indent}} |
} |
{% elif argument.enum_values %} |
{# Invalid enum values: http://www.w3.org/TR/WebIDL/#idl-enums #} |