| 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 provides shared functionality for the systems to generate | 6 """This module provides shared functionality for the systems to generate |
| 7 dart2js binding from the IDL database.""" | 7 dart2js binding from the IDL database.""" |
| 8 | 8 |
| 9 import os | 9 import os |
| 10 from generator import * | 10 from generator import * |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 info: An OperationInfo object. | 370 info: An OperationInfo object. |
| 371 """ | 371 """ |
| 372 # TODO(vsm): Handle overloads. | 372 # TODO(vsm): Handle overloads. |
| 373 params = info.ParametersImplementationDeclaration( | 373 params = info.ParametersImplementationDeclaration( |
| 374 lambda type_name: self._NarrowInputType(type_name)) | 374 lambda type_name: self._NarrowInputType(type_name)) |
| 375 | 375 |
| 376 native_string = '' | 376 native_string = '' |
| 377 if info.declared_name != info.name: | 377 if info.declared_name != info.name: |
| 378 native_string = " '%s'" % info.declared_name | 378 native_string = " '%s'" % info.declared_name |
| 379 | 379 |
| 380 native_body = dom_dart2js_native_bodies.get( | |
| 381 self._interface.id + '.' + info.name, '') | |
| 382 if native_body: | |
| 383 native_string = " '''" + native_body + "'''" | |
| 384 | |
| 385 self._members_emitter.Emit( | 380 self._members_emitter.Emit( |
| 386 '\n' | 381 '\n' |
| 387 ' $TYPE $NAME($PARAMS) native$NATIVESTRING;\n', | 382 ' $TYPE $NAME($PARAMS) native$NATIVESTRING;\n', |
| 388 TYPE=self._NarrowOutputType(info.type_name), | 383 TYPE=self._NarrowOutputType(info.type_name), |
| 389 NAME=info.name, | 384 NAME=info.name, |
| 390 PARAMS=params, | 385 PARAMS=params, |
| 391 NATIVESTRING=native_string) | 386 NATIVESTRING=native_string) |
| OLD | NEW |