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

Unified Diff: Source/bindings/scripts/v8_types.py

Issue 232563003: API functions returning Promises should not throw exceptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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: Source/bindings/scripts/v8_types.py
diff --git a/Source/bindings/scripts/v8_types.py b/Source/bindings/scripts/v8_types.py
index d6acc6067ffb8b9cb9f3d29932609987a944a021..574eedd851d5d59380a1348e01b869145e47f6c6 100644
--- a/Source/bindings/scripts/v8_types.py
+++ b/Source/bindings/scripts/v8_types.py
@@ -488,7 +488,7 @@ def v8_value_to_cpp_value_array_or_sequence(native_array_element_type, v8_value,
return expression
-def v8_value_to_local_cpp_value(idl_type, extended_attributes, v8_value, variable_name, index=None, declare_variable=True, isolate='info.GetIsolate()', used_in_private_script=False):
+def v8_value_to_local_cpp_value(idl_type, extended_attributes, v8_value, variable_name, index=None, declare_variable=True, isolate='info.GetIsolate()', used_in_private_script=False, async=False):
"""Returns an expression that converts a V8 value to a C++ value and stores it as a local value."""
# FIXME: Support union type.
@@ -515,6 +515,14 @@ def v8_value_to_local_cpp_value(idl_type, extended_attributes, v8_value, variabl
# v8::TryCatch.
suffix = ''
+ suffix = ''
Jens Widell 2014/07/30 10:29:10 This line duplicates the one above.
yhirano 2014/07/31 03:03:25 Thanks, done.
+
+ if async:
+ suffix += '_ASYNC'
+ args.append('info')
+ if macro == 'TONATIVE_VOID_EXCEPTIONSTATE':
+ args.insert(0, 'ScriptState::current(%s)' % isolate)
+
if declare_variable:
args.insert(0, this_cpp_type)
else:

Powered by Google App Engine
This is Rietveld 408576698