Index: Source/bindings/templates/dictionary_v8.cpp |
diff --git a/Source/bindings/templates/dictionary_v8.cpp b/Source/bindings/templates/dictionary_v8.cpp |
index 4a18170cb29058d92729815863db2bfd84510c02..c5087b333719489a8959a3384b04820d99199c18 100644 |
--- a/Source/bindings/templates/dictionary_v8.cpp |
+++ b/Source/bindings/templates/dictionary_v8.cpp |
@@ -15,6 +15,11 @@ namespace blink { |
{{cpp_class}}* {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Handle<v8::Value> v8Value, ExceptionState& exceptionState) |
{ |
+ if (!isUndefinedOrNull(v8Value) && !v8Value->IsObject()) { |
+ // Just returns 0. A TypeError will be thrown later. |
+ return 0; |
+ } |
+ |
{{cpp_class}}* impl = {{cpp_class}}::create(); |
// FIXME: Do not use Dictionary and DictionaryHelper |
// https://crbug.com/321462 |