Chromium Code Reviews| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 274 | 274 |
| 275 def FixEventTargets(self, database): | 275 def FixEventTargets(self, database): |
| 276 for interface in database.GetInterfaces(): | 276 for interface in database.GetInterfaces(): |
| 277 # Create fake EventTarget parent interface for interfaces that have | 277 # Create fake EventTarget parent interface for interfaces that have |
| 278 # 'EventTarget' extended attribute. | 278 # 'EventTarget' extended attribute. |
| 279 if 'EventTarget' in interface.ext_attrs: | 279 if 'EventTarget' in interface.ext_attrs: |
| 280 ast = [('Annotation', [('Id', 'WebKit')]), | 280 ast = [('Annotation', [('Id', 'WebKit')]), |
| 281 ('InterfaceType', ('ScopedName', 'EventTarget'))] | 281 ('InterfaceType', ('ScopedName', 'EventTarget'))] |
| 282 interface.parents.append(idlnode.IDLParentInterface(ast)) | 282 interface.parents.append(idlnode.IDLParentInterface(ast)) |
| 283 | 283 |
| 284 def AddMissingArguments(self, database): | |
| 285 ARG = idlnode.IDLArgument([('Type', ('ScopedName', 'Object')), ('Id', 'arg') ]) | |
| 286 for interface in database.GetInterfaces(): | |
| 287 for operation in interface.operations: | |
| 288 if operation.ext_attrs.get('CallWith') == 'ScriptArguments|CallStack': | |
|
podivilov
2012/08/21 11:50:34
I thought we decided to avoid patching the databas
Anton Muhin
2012/08/21 12:03:37
The problem is I failed to find the best place for
| |
| 289 operation.arguments.append(ARG) | |
| 290 | |
| 284 # ------------------------------------------------------------------------------ | 291 # ------------------------------------------------------------------------------ |
| 285 | 292 |
| 286 class DummyImplementationSystem(systembase.System): | 293 class DummyImplementationSystem(systembase.System): |
| 287 """Generates a dummy implementation for use by the editor analysis. | 294 """Generates a dummy implementation for use by the editor analysis. |
| 288 | 295 |
| 289 All the code comes from hand-written library files. | 296 All the code comes from hand-written library files. |
| 290 """ | 297 """ |
| 291 | 298 |
| 292 def __init__(self, options): | 299 def __init__(self, options): |
| 293 super(DummyImplementationSystem, self).__init__(options) | 300 super(DummyImplementationSystem, self).__init__(options) |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 338 PARAMETERS=constructor_info.ParametersImplementationDeclaration(DartType )) | 345 PARAMETERS=constructor_info.ParametersImplementationDeclaration(DartType )) |
| 339 | 346 |
| 340 def FinishInterface(self): | 347 def FinishInterface(self): |
| 341 pass | 348 pass |
| 342 | 349 |
| 343 def AddTypedArrayConstructors(self, element_type): | 350 def AddTypedArrayConstructors(self, element_type): |
| 344 pass | 351 pass |
| 345 | 352 |
| 346 def AddEventAttributes(self, event_attrs): | 353 def AddEventAttributes(self, event_attrs): |
| 347 pass | 354 pass |
| OLD | NEW |