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

Side by Side Diff: tools/dom/scripts/dartgenerator.py

Issue 12217130: EventTarget was marked as EventTarget upstream. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 """This module generates Dart APIs from the IDL database.""" 6 """This module generates Dart APIs from the IDL database."""
7 7
8 import emitter 8 import emitter
9 import idlnode 9 import idlnode
10 import logging 10 import logging
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 for operation in interface.operations: 210 for operation in interface.operations:
211 if operation.raises: 211 if operation.raises:
212 exceptions.add(operation.raises.id) 212 exceptions.add(operation.raises.id)
213 return exceptions 213 return exceptions
214 214
215 215
216 def FixEventTargets(self, database): 216 def FixEventTargets(self, database):
217 for interface in database.GetInterfaces(): 217 for interface in database.GetInterfaces():
218 # Create fake EventTarget parent interface for interfaces that have 218 # Create fake EventTarget parent interface for interfaces that have
219 # 'EventTarget' extended attribute. 219 # 'EventTarget' extended attribute.
220 if 'EventTarget' in interface.ext_attrs: 220 if 'EventTarget' in interface.ext_attrs and interface.id != 'EventTarget':
221 ast = [('Annotation', [('Id', 'WebKit')]), 221 ast = [('Annotation', [('Id', 'WebKit')]),
222 ('InterfaceType', ('ScopedName', 'EventTarget'))] 222 ('InterfaceType', ('ScopedName', 'EventTarget'))]
223 interface.parents.append(idlnode.IDLParentInterface(ast)) 223 interface.parents.append(idlnode.IDLParentInterface(ast))
224 224
225 def AddMissingArguments(self, database): 225 def AddMissingArguments(self, database):
226 ARG = idlnode.IDLArgument([('Type', ('ScopedName', 'object')), ('Id', 'arg') ]) 226 ARG = idlnode.IDLArgument([('Type', ('ScopedName', 'object')), ('Id', 'arg') ])
227 for interface in database.GetInterfaces(): 227 for interface in database.GetInterfaces():
228 for operation in interface.operations: 228 for operation in interface.operations:
229 if operation.ext_attrs.get('CallWith') == 'ScriptArguments|ScriptState': 229 if operation.ext_attrs.get('CallWith') == 'ScriptArguments|ScriptState':
230 operation.arguments.append(ARG) 230 operation.arguments.append(ARG)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698