Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl |
| diff --git a/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl |
| index 7ed4d7fc98e4581c2e4b3d1c61e923f1bff1b3c4..3edd411ba1ba2f3e956f2ccc9a14edfbb4d6304a 100644 |
| --- a/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl |
| +++ b/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl |
| @@ -892,7 +892,10 @@ v8::Local<v8::Object> {{v8_class}}::findInstanceInPrototypeChain(v8::Local<v8::V |
| {##############################################################################} |
| {% block native_value_traits %} |
| {{cpp_class}}* NativeValueTraits<{{cpp_class}}>::nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) { |
| - return {{v8_class}}::toImplWithTypeCheck(isolate, value); |
| + {{cpp_class}}* nativeValue = {{v8_class}}::toImplWithTypeCheck(isolate, value); |
| + if (!nativeValue) |
| + exceptionState.throwTypeError("Unable to convert value to {{cpp_class}}."); |
|
Yuki
2017/04/07 13:37:21
nit: Can we use {{interface_name}} instead?
This i
|
| + return nativeValue; |
| } |
| {% endblock %} |