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

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

Issue 604833002: Use ExceptionState when converting string arguments to promise methods (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
Index: Source/bindings/scripts/v8_types.py
diff --git a/Source/bindings/scripts/v8_types.py b/Source/bindings/scripts/v8_types.py
index 839d68fc445d684380c262c06772eb590826ad18..3994db6353ee03ceafe805ea8d58421c85487fff 100644
--- a/Source/bindings/scripts/v8_types.py
+++ b/Source/bindings/scripts/v8_types.py
@@ -570,10 +570,12 @@ def v8_value_to_local_cpp_value(idl_type, extended_attributes, v8_value, variabl
cpp_value = v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, index, isolate)
args = [variable_name, cpp_value]
if idl_type.base_type == 'DOMString':
- macro = 'TOSTRING_DEFAULT' if used_in_private_script else 'TOSTRING_VOID'
+ if return_promise:
+ macro = 'TOSTRING_VOID_EXCEPTIONSTATE'
+ else:
+ macro = 'TOSTRING_DEFAULT' if used_in_private_script else 'TOSTRING_VOID'
elif idl_type.v8_conversion_needs_exception_state:
macro = 'TONATIVE_DEFAULT_EXCEPTIONSTATE' if used_in_private_script else 'TONATIVE_VOID_EXCEPTIONSTATE'
- args.append('exceptionState')
elif idl_type.v8_conversion_is_trivial:
assignment = '%s = %s' % (variable_name, cpp_value)
if declare_variable:
@@ -582,6 +584,9 @@ def v8_value_to_local_cpp_value(idl_type, extended_attributes, v8_value, variabl
else:
macro = 'TONATIVE_DEFAULT' if used_in_private_script else 'TONATIVE_VOID'
+ if macro.endswith('_EXCEPTIONSTATE'):
+ args.append('exceptionState')
+
if used_in_private_script:
args.append('false')
@@ -592,7 +597,7 @@ def v8_value_to_local_cpp_value(idl_type, extended_attributes, v8_value, variabl
if return_promise:
suffix += '_PROMISE'
args.append('info')
- if macro == 'TONATIVE_VOID_EXCEPTIONSTATE':
+ if macro.endswith('_EXCEPTIONSTATE'):
args.append('ScriptState::current(%s)' % isolate)
if declare_variable:

Powered by Google App Engine
This is Rietveld 408576698