Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Unified Diff: Source/bindings/templates/methods.cpp

Issue 1079983002: Introduce SmallTypedArray IDL type and use it for bufferSubData (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: updates Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 #}

Powered by Google App Engine
This is Rietveld 408576698