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

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

Issue 860353002: IDL: Add toRestricted{Float,Double}() helpers to V8Binding.h (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add FIXME comment Created 5 years, 11 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_dictionary.py
diff --git a/Source/bindings/scripts/v8_dictionary.py b/Source/bindings/scripts/v8_dictionary.py
index 5598cdb9bf100741595277fe9be5640f0ccca33a..f6a05787ce9cf6fbd778b0bf197530a2bd0eebc0 100644
--- a/Source/bindings/scripts/v8_dictionary.py
+++ b/Source/bindings/scripts/v8_dictionary.py
@@ -11,6 +11,7 @@ from idl_types import IdlType
from v8_globals import includes
import v8_types
import v8_utilities
+from v8_utilities import has_extended_attribute_value
DICTIONARY_H_INCLUDES = frozenset([
@@ -56,7 +57,7 @@ def dictionary_context(dictionary, interfaces_info):
context = {
'cpp_class': cpp_class,
'header_includes': set(DICTIONARY_H_INCLUDES),
- 'members': [member_context(member)
+ 'members': [member_context(dictionary, member)
for member in sorted(dictionary.members,
key=operator.attrgetter('name'))],
'use_permissive_dictionary_conversion': 'PermissiveDictionaryConversion' in dictionary.extended_attributes,
@@ -74,11 +75,15 @@ def dictionary_context(dictionary, interfaces_info):
return context
-def member_context(member):
+def member_context(dictionary, member):
idl_type = member.idl_type
idl_type.add_includes_for_type()
unwrapped_idl_type = unwrap_nullable_if_needed(idl_type)
+ restricted_float = (
+ has_extended_attribute_value(dictionary, 'TypeChecking', 'Unrestricted') or
+ has_extended_attribute_value(member, 'TypeChecking', 'Unrestricted'))
+
def default_values():
if not member.default_value:
return None, None
@@ -115,7 +120,7 @@ def member_context(member):
'v8_default_value': v8_default_value,
'v8_value_to_local_cpp_value': unwrapped_idl_type.v8_value_to_local_cpp_value(
member.extended_attributes, member.name + 'Value',
- member.name, isolate='isolate'),
+ member.name, isolate='isolate', restricted_float=restricted_float),
}

Powered by Google App Engine
This is Rietveld 408576698