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

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

Issue 2791133002: bindings: Explicitly pass ValueType to toImplArray (Closed)
Patch Set: Fix tests Created 3 years, 9 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: third_party/WebKit/Source/bindings/scripts/v8_types.py
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_types.py b/third_party/WebKit/Source/bindings/scripts/v8_types.py
index 6e1cb2c556771bb86a1f4ad79bf19d1f4524aedd..a8dd9a4770595f157868bd41d3fc0189fdf8e8cd 100644
--- a/third_party/WebKit/Source/bindings/scripts/v8_types.py
+++ b/third_party/WebKit/Source/bindings/scripts/v8_types.py
@@ -639,7 +639,16 @@ def v8_value_to_cpp_value_array_or_sequence(native_array_element_type, v8_value,
vector_type = 'HeapVector'
else:
vector_type = 'Vector'
- expression_format = 'toImplArray<%s<{cpp_type}>>({v8_value}, {index}, {isolate}, exceptionState)' % vector_type
+ if native_array_element_type.is_primitive_type:
haraken 2017/04/03 04:29:02 Why do we need to limit this to primitive types?
bashi 2017/04/03 04:42:34 Just to minimize the impact of changes to see if t
bashi 2017/04/03 05:06:25 Looks like we need to improve coverage of native_v
Raphael Kubo da Costa (rakuco) 2017/04/06 13:22:36 (belatedly adding myself to the party) Are you ac
+ value_type = native_value_traits_type_name(native_array_element_type)
+ expression_format = ('toImplArray<%s<{cpp_type}>, %s>'
+ '({v8_value}, {index}, {isolate}, '
+ 'exceptionState)' % (vector_type, value_type))
+ else:
+ expression_format = ('toImplArray<%s<{cpp_type}>>'
+ '({v8_value}, {index}, {isolate}, '
+ 'exceptionState)' % vector_type)
+
expression = expression_format.format(native_array_element_type=native_array_element_type.name, cpp_type=this_cpp_type,
index=index, v8_value=v8_value, isolate=isolate)
return expression

Powered by Google App Engine
This is Rietveld 408576698