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

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

Issue 715353002: IDL: Support callback function types in overload resolution (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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/idls/core/TestObject.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/v8_interface.py
diff --git a/Source/bindings/scripts/v8_interface.py b/Source/bindings/scripts/v8_interface.py
index 7e86bcf1918321cf0d4c97be1d8d463f3c7e6cf4..96c83e4bcc2226bcbbde3eb501ebf1f78cccdfa7 100644
--- a/Source/bindings/scripts/v8_interface.py
+++ b/Source/bindings/scripts/v8_interface.py
@@ -842,12 +842,33 @@ def resolution_tests_methods(effective_overloads):
test = 'V8{idl_type}::hasInstance({cpp_value}, info.GetIsolate())'.format(idl_type=idl_type.base_type, cpp_value=cpp_value)
yield test, method
- # 8. Otherwise: if V is any kind of object except for a native Date object,
+ # 13. Otherwise: if IsCallable(V) is true, and there is an entry in S that
+ # has one of the following types at position i of its type list,
+ # • a callback function type
+ # ...
+ #
+ # FIXME:
+ # We test for functions rather than callability, which isn't strictly the
+ # same thing.
+ try:
+ method = next(method for idl_type, method in idl_types_methods
+ if idl_type.is_callback_function)
+ test = '%s->IsFunction()' % cpp_value
+ yield test, method
+ except StopIteration:
+ pass
+
+ # 14. Otherwise: if V is any kind of object except for a native Date object,
# a native RegExp object, and there is an entry in S that has one of the
# following types at position i of its type list,
- # • an array type
# • a sequence type
# ...
+ #
+ # 15. Otherwise: if V is any kind of object except for a native Date object,
+ # a native RegExp object, and there is an entry in S that has one of the
+ # following types at position i of its type list,
+ # • an array type
+ # ...
# • a dictionary
#
# FIXME:
« no previous file with comments | « no previous file | Source/bindings/tests/idls/core/TestObject.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698