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

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

Issue 345393004: IDL: Support 'stringifier' keyword (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: moved logic to v8_interface.py Created 6 years, 6 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_interface.py
diff --git a/Source/bindings/scripts/v8_interface.py b/Source/bindings/scripts/v8_interface.py
index 9f790a3e93270d875ab485e18049850158741196..13c5990434343b3d03d1a7a25d38d3a0afaf8c10 100644
--- a/Source/bindings/scripts/v8_interface.py
+++ b/Source/bindings/scripts/v8_interface.py
@@ -36,6 +36,8 @@ from collections import defaultdict
import itertools
from operator import itemgetter
+import idl_definitions
+from idl_definitions import IdlOperation
import idl_types
from idl_types import IdlType, inherits_interface
import v8_attributes
@@ -252,6 +254,19 @@ def interface_context(interface):
if method.name] # Skip anonymous special operations (methods)
compute_method_overloads_context(methods)
+ # Stringifier
+ if interface.stringifier:
+ stringifier = interface.stringifier
+ method = IdlOperation()
+ method.name = 'toString'
+ method.idl_type = IdlType('DOMString')
+ method.extended_attributes.update(stringifier.extended_attributes)
haraken 2014/06/24 08:28:36 method.extended_attributes = stringifier.extended_
Jens Widell 2014/06/24 08:38:43 I'm modifying method.extended_attributes below, an
+ if stringifier.attribute:
haraken 2014/06/24 08:28:36 stringifier.attribute and stringifier.attribute.na
Jens Widell 2014/06/24 08:38:43 The attribute can't be unnamed. That would be s
+ method.extended_attributes['ImplementedAs'] = stringifier.attribute.name
+ elif stringifier.operation and stringifier.operation.name:
+ method.extended_attributes['ImplementedAs'] = stringifier.operation.name
+ methods.append(v8_methods.method_context(interface, method))
+
per_context_enabled_methods = []
custom_registration_methods = []
method_configuration_methods = []

Powered by Google App Engine
This is Rietveld 408576698