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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 # Create fake EventTarget parent interface for interfaces that have | 222 # Create fake EventTarget parent interface for interfaces that have |
223 # 'EventTarget' extended attribute. | 223 # 'EventTarget' extended attribute. |
224 ast = [('Annotation', [('Id', 'WebKit')]), | 224 ast = [('Annotation', [('Id', 'WebKit')]), |
225 ('InterfaceType', ('ScopedName', 'EventTarget'))] | 225 ('InterfaceType', ('ScopedName', 'EventTarget'))] |
226 interface.parents.append(idlnode.IDLParentInterface(ast)) | 226 interface.parents.append(idlnode.IDLParentInterface(ast)) |
227 | 227 |
228 def AddMissingArguments(self, database): | 228 def AddMissingArguments(self, database): |
229 ARG = idlnode.IDLArgument([('Type', ('ScopedName', 'object')), ('Id', 'arg')
]) | 229 ARG = idlnode.IDLArgument([('Type', ('ScopedName', 'object')), ('Id', 'arg')
]) |
230 for interface in database.GetInterfaces(): | 230 for interface in database.GetInterfaces(): |
231 for operation in interface.operations: | 231 for operation in interface.operations: |
232 call_with = (operation.ext_attrs.get('CallWith', '') + | 232 call_with = (operation.ext_attrs.get('CallWith', '').split('|') + |
233 operation.ext_attrs.get('ConstructorCallWith', '')) | 233 operation.ext_attrs.get('ConstructorCallWith', '').split('|
') + |
| 234 operation.ext_attrs.get('CallWith', '').split('&') + |
| 235 operation.ext_attrs.get('ConstructorCallWith', '').split('&
')) |
234 if 'ScriptArguments' in call_with: | 236 if 'ScriptArguments' in call_with: |
235 operation.arguments.append(ARG) | 237 operation.arguments.append(ARG) |
OLD | NEW |