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

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

Issue 556893002: Move IdlType.may_raise_exception_on_conversion to v8_types.py (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
« no previous file with comments | « Source/bindings/scripts/v8_methods.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/v8_types.py
diff --git a/Source/bindings/scripts/v8_types.py b/Source/bindings/scripts/v8_types.py
index 4bc44bdb694f2da27b7c98b100b185f34d47b85e..1c2d7b8c01b00452f6edbcc376bb929b9c343d7e 100644
--- a/Source/bindings/scripts/v8_types.py
+++ b/Source/bindings/scripts/v8_types.py
@@ -473,6 +473,13 @@ V8_VALUE_TO_CPP_VALUE = {
}
+def v8_conversion_needs_exception_state(idl_type):
+ return (idl_type.is_integer_type or
+ idl_type.name in ('ByteString', 'ScalarValueString'))
+
+IdlType.v8_conversion_needs_exception_state = property(v8_conversion_needs_exception_state)
+
+
def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, index, isolate):
if idl_type.name == 'void':
return ''
@@ -489,7 +496,7 @@ def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, index, isolat
if 'EnforceRange' in extended_attributes:
arguments = ', '.join([v8_value, 'EnforceRange', 'exceptionState'])
- elif idl_type.may_raise_exception_on_conversion:
+ elif idl_type.v8_conversion_needs_exception_state:
arguments = ', '.join([v8_value, 'exceptionState'])
else:
arguments = v8_value
@@ -544,7 +551,7 @@ def v8_value_to_local_cpp_value(idl_type, extended_attributes, v8_value, variabl
args = [variable_name, cpp_value]
if idl_type.base_type == 'DOMString':
macro = 'TOSTRING_DEFAULT' if used_in_private_script else 'TOSTRING_VOID'
- elif idl_type.may_raise_exception_on_conversion:
+ elif idl_type.v8_conversion_needs_exception_state:
macro = 'TONATIVE_DEFAULT_EXCEPTIONSTATE' if used_in_private_script else 'TONATIVE_VOID_EXCEPTIONSTATE'
args.append('exceptionState')
else:
« no previous file with comments | « Source/bindings/scripts/v8_methods.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698