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

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

Issue 1011093002: [bindings] Pass NormalConversion to to[U]Int{8/16/32/64}(...) in v8_types.py and reduce conversion … (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing after review comments! :) Created 5 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: Source/bindings/scripts/v8_types.py
diff --git a/Source/bindings/scripts/v8_types.py b/Source/bindings/scripts/v8_types.py
index 96fe1790e78f77a595885a6a8f46b1ba0caea40b..646d7fc450cb5cbf9be10319993338d7071568d4 100644
--- a/Source/bindings/scripts/v8_types.py
+++ b/Source/bindings/scripts/v8_types.py
@@ -541,10 +541,13 @@ def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, variable_name
add_includes_for_type(idl_type)
base_idl_type = idl_type.as_union_type.name if idl_type.is_union_type else idl_type.base_type
- if 'EnforceRange' in extended_attributes:
- arguments = ', '.join([v8_value, 'EnforceRange', 'exceptionState'])
- elif 'Clamp' in extended_attributes:
- arguments = ', '.join([v8_value, 'Clamp', 'exceptionState'])
+ if idl_type.is_integer_type:
+ configuration = 'NormalConversion'
+ if 'EnforceRange' in extended_attributes:
+ configuration = 'EnforceRange'
+ elif 'Clamp' in extended_attributes:
+ configuration = 'Clamp'
+ arguments = ', '.join([v8_value, configuration, 'exceptionState'])
elif idl_type.v8_conversion_needs_exception_state:
arguments = ', '.join([v8_value, 'exceptionState'])
else:
« no previous file with comments | « Source/bindings/core/v8/custom/V8BlobCustomHelpers.cpp ('k') | Source/bindings/tests/results/core/UnionTypesCore.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698