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

Unified Diff: third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl

Issue 2809003004: bindings: Use ExceptionMessages when an interface/callback conversion fails. (Closed)
Patch Set: Add ExceptionMessages::FailedToConvertJSValue Created 3 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: 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 289ea7ebb4aca137de40131adcd5010ace36367c..bbd979c5b9b12cab33e22c750d0d187d01e2f380 100644
--- a/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl
+++ b/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl
@@ -893,8 +893,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) {
{{cpp_class}}* nativeValue = {{v8_class}}::toImplWithTypeCheck(isolate, value);
- if (!nativeValue)
- exceptionState.ThrowTypeError("Unable to convert value to {{interface_name}}.");
+ if (!nativeValue) {
+ exceptionState.ThrowTypeError(ExceptionMessages::FailedToConvertJSValue(
+ "{{interface_name}}"));
+ }
return nativeValue;
}

Powered by Google App Engine
This is Rietveld 408576698