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

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

Issue 556273003: In generated dictionary toImpl(), throw all exceptions via ExceptionState (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: added FIXME comment Created 6 years, 3 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/results/core/V8TestDictionary.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/templates/dictionary_v8.cpp
diff --git a/Source/bindings/templates/dictionary_v8.cpp b/Source/bindings/templates/dictionary_v8.cpp
index 77a6b3c6820616bc3cdd2b7bfdd68fdf3753957f..4a18170cb29058d92729815863db2bfd84510c02 100644
--- a/Source/bindings/templates/dictionary_v8.cpp
+++ b/Source/bindings/templates/dictionary_v8.cpp
@@ -19,6 +19,9 @@ namespace blink {
// FIXME: Do not use Dictionary and DictionaryHelper
// https://crbug.com/321462
Dictionary dictionary(v8Value, isolate);
+ // FIXME: Remove this v8::TryCatch once the code is switched from
+ // Dictionary/DictionaryHelper to something that uses ExceptionState.
+ v8::TryCatch block;
{% for member in members %}
{{member.cpp_type}} {{member.name}};
if (DictionaryHelper::getWithUndefinedOrNullCheck(dictionary, "{{member.name}}", {{member.name}})) {
@@ -30,6 +33,9 @@ namespace blink {
}
{% endif %}
impl->{{member.setter_name}}({{member.name}});
+ } else if (block.HasCaught()) {
+ exceptionState.rethrowV8Exception(block.Exception());
+ return 0;
}
{% endfor %}
return impl;
« no previous file with comments | « no previous file | Source/bindings/tests/results/core/V8TestDictionary.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698