| OLD | NEW |
| 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 def FixEventTargets(self, database): | 267 def FixEventTargets(self, database): |
| 268 for interface in database.GetInterfaces(): | 268 for interface in database.GetInterfaces(): |
| 269 # Create fake EventTarget parent interface for interfaces that have | 269 # Create fake EventTarget parent interface for interfaces that have |
| 270 # 'EventTarget' extended attribute. | 270 # 'EventTarget' extended attribute. |
| 271 if 'EventTarget' in interface.ext_attrs: | 271 if 'EventTarget' in interface.ext_attrs: |
| 272 ast = [('Annotation', [('Id', 'WebKit')]), | 272 ast = [('Annotation', [('Id', 'WebKit')]), |
| 273 ('InterfaceType', ('ScopedName', 'EventTarget'))] | 273 ('InterfaceType', ('ScopedName', 'EventTarget'))] |
| 274 interface.parents.append(idlnode.IDLParentInterface(ast)) | 274 interface.parents.append(idlnode.IDLParentInterface(ast)) |
| 275 | 275 |
| 276 def AddMissingArguments(self, database): | 276 def AddMissingArguments(self, database): |
| 277 ARG = idlnode.IDLArgument([('Type', ('ScopedName', 'Object')), ('Id', 'arg')
]) | 277 ARG = idlnode.IDLArgument([('Type', ('ScopedName', 'object')), ('Id', 'arg')
]) |
| 278 for interface in database.GetInterfaces(): | 278 for interface in database.GetInterfaces(): |
| 279 for operation in interface.operations: | 279 for operation in interface.operations: |
| 280 if operation.ext_attrs.get('CallWith') == 'ScriptArguments|CallStack': | 280 if operation.ext_attrs.get('CallWith') == 'ScriptArguments|CallStack': |
| 281 operation.arguments.append(ARG) | 281 operation.arguments.append(ARG) |
| OLD | NEW |