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

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

Issue 600833003: Conversion of any, NodeFilter and XPathNSResolver arguments is trivial (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 | « no previous file | Source/bindings/tests/results/core/V8TestObject.cpp » ('j') | 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 df05d16f21b0682b0f6c21204573820cc97882da..8122173ffba98677ec875912491501a44a451d3e 100644
--- a/Source/bindings/scripts/v8_types.py
+++ b/Source/bindings/scripts/v8_types.py
@@ -477,11 +477,19 @@ def v8_conversion_needs_exception_state(idl_type):
IdlType.v8_conversion_needs_exception_state = property(v8_conversion_needs_exception_state)
+TRIVIAL_CONVERSIONS = frozenset([
+ 'any',
+ 'boolean',
+ 'Dictionary',
+ 'NodeFilter',
+ 'XPathNSResolver'
+])
+
+
def v8_conversion_is_trivial(idl_type):
# The conversion is a simple expression that returns the converted value and
# cannot raise an exception.
- return (idl_type.base_type == 'boolean' or
- idl_type.base_type == 'Dictionary' or
+ return (idl_type.base_type in TRIVIAL_CONVERSIONS or
idl_type.is_wrapper_type)
IdlType.v8_conversion_is_trivial = property(v8_conversion_is_trivial)
« no previous file with comments | « no previous file | Source/bindings/tests/results/core/V8TestObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698