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

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 c2ebdcd17f1ec7428f7727a8f514f7d577c96930..ba5b67bbf56846ab976556c5884aa09f64770f01 100644
--- a/Source/bindings/scripts/v8_types.py
+++ b/Source/bindings/scripts/v8_types.py
@@ -523,7 +523,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.
@@ -550,6 +550,12 @@ def v8_value_to_local_cpp_value(idl_type, extended_attributes, v8_value, variabl
# v8::TryCatch.
suffix = ''
+ if async:
+ suffix += '_ASYNC'
+ args.append('info')
+ if macro == 'TONATIVE_VOID_EXCEPTIONSTATE':
haraken 2014/07/31 07:54:47 A slightly better condition would be: if idl_ty
yhirano 2014/08/01 02:27:57 That condition can be true when macro is 'TOSTRING
+ args.insert(0, 'ScriptState::current(%s)' % isolate)
haraken 2014/07/31 07:54:47 Can we move the ScriptState argument to the last a
yhirano 2014/08/01 02:27:57 Done.
+
if declare_variable:
args.insert(0, this_cpp_type)
else:

Powered by Google App Engine
This is Rietveld 408576698