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

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

Issue 894693005: IDL: Auto-declare implied methods only if not otherwise declared (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix spelling Created 5 years, 10 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/idls/core/TestInterface3.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 623308484300aed627cf267fdfd48297db28a051..8b80f3b120428d406e0f0efff62302e9c98c0a72 100644
--- a/Source/bindings/scripts/v8_interface.py
+++ b/Source/bindings/scripts/v8_interface.py
@@ -384,7 +384,7 @@ def interface_context(interface):
iterator_method = generated_iterator_method('iterator')
if interface.iterable or interface.maplike or interface.setlike:
- methods.extend([
+ implicit_methods = [
generated_iterator_method('keys'),
generated_iterator_method('values'),
generated_iterator_method('entries'),
@@ -396,7 +396,17 @@ def interface_context(interface):
is_optional=True,
extended_attributes={'Default': 'Undefined'})],
extended_attributes=forEach_extended_attributes),
- ])
+ ]
+
+ methods_by_name = {}
+ for method in methods:
+ methods_by_name.setdefault(method['name'], []).append(method)
+
+ for implicit_method in implicit_methods:
+ if implicit_method['name'] in methods_by_name:
+ # FIXME: Check that the existing method is compatible.
+ continue
+ methods.append(implicit_method)
# FIXME: maplike<> and setlike<> should also imply the presence of a
# subset of keys(), values(), entries(), forEach(), has(), get(), add(),
« no previous file with comments | « no previous file | Source/bindings/tests/idls/core/TestInterface3.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698