Index: Source/bindings/templates/attributes.cpp |
diff --git a/Source/bindings/templates/attributes.cpp b/Source/bindings/templates/attributes.cpp |
index 00232bf6f7b8b4ffd4052d92f743a8d1d748e4d6..95b914522cd70670198f3ddecd3de993ab10f5e2 100644 |
--- a/Source/bindings/templates/attributes.cpp |
+++ b/Source/bindings/templates/attributes.cpp |
@@ -217,16 +217,6 @@ v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info |
{% if attribute.has_setter_exception_state %} |
ExceptionState exceptionState(ExceptionState::SetterContext, "{{attribute.name}}", "{{interface_name}}", holder, info.GetIsolate()); |
{% endif %} |
- {# Type checking #} |
- {% if attribute.has_type_checking_interface %} |
- {# Type checking for interface types (if interface not implemented, throw |
- TypeError), per http://www.w3.org/TR/WebIDL/#es-interface #} |
- if ({% if attribute.is_nullable %}!isUndefinedOrNull(v8Value) && {% endif %}!V8{{attribute.idl_type}}::hasInstance(v8Value, info.GetIsolate())) { |
- exceptionState.throwTypeError("The provided value is not of type '{{attribute.idl_type}}'."); |
- exceptionState.throwIfNeeded(); |
- return; |
- } |
- {% endif %} |
{% if attribute.use_output_parameter_for_result %} |
{{attribute.cpp_type}} cppValue; |
{% endif %} |
@@ -260,6 +250,14 @@ v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info |
exceptionState.throwIfNeeded(); |
return; |
} |
+ {% elif attribute.has_type_checking_interface %} |
+ {# Type checking for interface types (if interface not implemented, throw |
+ TypeError), per http://www.w3.org/TR/WebIDL/#es-interface #} |
+ if (!cppValue{% if attribute.is_nullable %} && !isUndefinedOrNull(v8Value){% endif %}) { |
+ exceptionState.throwTypeError("The provided value is not of type '{{attribute.idl_type}}'."); |
+ exceptionState.throwIfNeeded(); |
+ return; |
+ } |
{% elif attribute.enum_validation_expression %} |
{# Setter ignores invalid enum values: |
http://www.w3.org/TR/WebIDL/#idl-enums #} |