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 555133003: Use ExceptionState to throw exceptions when converting arrays (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 746bf9c15d680356c88b8995b056cb81fce76e99..9d08eca9cb4d3680b5dc9ae066aa7733dea88578 100644
--- a/Source/bindings/scripts/v8_types.py
+++ b/Source/bindings/scripts/v8_types.py
@@ -479,6 +479,7 @@ def v8_conversion_needs_exception_state(idl_type):
idl_type.name in ('ByteString', 'ScalarValueString'))
IdlType.v8_conversion_needs_exception_state = property(v8_conversion_needs_exception_state)
+IdlArrayOrSequenceType.v8_conversion_needs_exception_state = True
def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, index, isolate):
@@ -528,12 +529,12 @@ def v8_value_to_cpp_value_array_or_sequence(native_array_element_type, v8_value,
native_array_element_type.name != 'Dictionary'):
this_cpp_type = None
ref_ptr_type = cpp_ptr_type('RefPtr', 'Member', native_array_element_type.gc_type)
- expression_format = '(to{ref_ptr_type}NativeArray<{native_array_element_type}, V8{native_array_element_type}>({v8_value}, {index}, {isolate}))'
+ expression_format = '(to{ref_ptr_type}NativeArray<{native_array_element_type}, V8{native_array_element_type}>({v8_value}, {index}, {isolate}, exceptionState))'
add_includes_for_type(native_array_element_type)
else:
ref_ptr_type = None
this_cpp_type = native_array_element_type.cpp_type
- expression_format = 'toImplArray<{cpp_type}>({v8_value}, {index}, {isolate})'
+ expression_format = 'toImplArray<{cpp_type}>({v8_value}, {index}, {isolate}, exceptionState)'
expression = expression_format.format(native_array_element_type=native_array_element_type.name, cpp_type=this_cpp_type, index=index, ref_ptr_type=ref_ptr_type, v8_value=v8_value, isolate=isolate)
return expression

Powered by Google App Engine
This is Rietveld 408576698