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

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

Issue 359763002: IDL: Avoid double type-check for variadic interface type arguments (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: the fix Created 6 years, 6 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
« no previous file with comments | « no previous file | Source/bindings/tests/idls/TestObject.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/templates/methods.cpp
diff --git a/Source/bindings/templates/methods.cpp b/Source/bindings/templates/methods.cpp
index 004152c91a53a8c350b818f39a4de2caff1cf93a..d1242e4eee3168de2a0b63efbd15664afa8c4eaf 100644
--- a/Source/bindings/templates/methods.cpp
+++ b/Source/bindings/templates/methods.cpp
@@ -121,9 +121,11 @@ if (UNLIKELY(info.Length() <= {{argument.index}})) {
return;
}
{% endif %}
-{% if argument.has_type_checking_interface %}
+{% if argument.has_type_checking_interface 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 #}
+ 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 below. #}
if (info.Length() > {{argument.index}} && {% if argument.is_nullable %}!isUndefinedOrNull(info[{{argument.index}}]) && {% endif %}!V8{{argument.idl_type}}::hasInstance(info[{{argument.index}}], info.GetIsolate())) {
{{throw_type_error(method, '"parameter %s is not of type \'%s\'."' %
(argument.index + 1, argument.idl_type)) | indent}}
« no previous file with comments | « no previous file | Source/bindings/tests/idls/TestObject.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698