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 native binding from the IDL database.""" | 7 native binding from the IDL database.""" |
8 | 8 |
9 import emitter | 9 import emitter |
10 import os | 10 import os |
(...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1332 | 1332 |
1333 if self._IsStatic(node.id): | 1333 if self._IsStatic(node.id): |
1334 needs_receiver = True | 1334 needs_receiver = True |
1335 | 1335 |
1336 cpp_arguments = [] | 1336 cpp_arguments = [] |
1337 runtime_check = None | 1337 runtime_check = None |
1338 raises_exceptions = raises_dom_exception or arguments or needs_receiver | 1338 raises_exceptions = raises_dom_exception or arguments or needs_receiver |
1339 needs_custom_element_callbacks = False | 1339 needs_custom_element_callbacks = False |
1340 | 1340 |
1341 # TODO(antonm): unify with ScriptState below. | 1341 # TODO(antonm): unify with ScriptState below. |
1342 call_with = ext_attrs.get('CallWith', '') + ext_attrs.get('ConstructorCallWi
th', '') | 1342 requires_stack_info = (ext_attrs.get('CallWith') == 'ScriptArguments|ScriptS
tate' or |
1343 requires_stack_info = 'ScriptArguments' in call_with or 'ScriptState' in cal
l_with | 1343 ext_attrs.get('ConstructorCallWith') == 'ScriptArgume
nts|ScriptState' or |
| 1344 ext_attrs.get('CallWith') == 'ScriptArguments&ScriptS
tate' or |
| 1345 ext_attrs.get('ConstructorCallWith') == 'ScriptArgume
nts&ScriptState') |
1344 if requires_stack_info: | 1346 if requires_stack_info: |
1345 raises_exceptions = True | 1347 raises_exceptions = True |
1346 cpp_arguments = ['&state', 'scriptArguments.release()'] | 1348 cpp_arguments = ['&state', 'scriptArguments.release()'] |
1347 # WebKit uses scriptArguments to reconstruct last argument, so | 1349 # WebKit uses scriptArguments to reconstruct last argument, so |
1348 # it's not needed and should be just removed. | 1350 # it's not needed and should be just removed. |
1349 arguments = arguments[:-1] | 1351 arguments = arguments[:-1] |
1350 | 1352 |
1351 # TODO(antonm): unify with ScriptState below. | 1353 # TODO(antonm): unify with ScriptState below. |
1352 requires_script_arguments = (ext_attrs.get('CallWith') == 'ScriptArguments'
or | 1354 requires_script_arguments = (ext_attrs.get('CallWith') == 'ScriptArguments'
or |
1353 ext_attrs.get('ConstructorCallWith') == 'Script
Arguments') | 1355 ext_attrs.get('ConstructorCallWith') == 'Script
Arguments') |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1999 | 2001 |
2000 def _IsCustom(op_or_attr): | 2002 def _IsCustom(op_or_attr): |
2001 assert(isinstance(op_or_attr, IDLMember)) | 2003 assert(isinstance(op_or_attr, IDLMember)) |
2002 return 'Custom' in op_or_attr.ext_attrs or 'DartCustom' in op_or_attr.ext_attr
s | 2004 return 'Custom' in op_or_attr.ext_attrs or 'DartCustom' in op_or_attr.ext_attr
s |
2003 | 2005 |
2004 def _IsCustomValue(op_or_attr, value): | 2006 def _IsCustomValue(op_or_attr, value): |
2005 if _IsCustom(op_or_attr): | 2007 if _IsCustom(op_or_attr): |
2006 return op_or_attr.ext_attrs.get('Custom') == value \ | 2008 return op_or_attr.ext_attrs.get('Custom') == value \ |
2007 or op_or_attr.ext_attrs.get('DartCustom') == value | 2009 or op_or_attr.ext_attrs.get('DartCustom') == value |
2008 return False | 2010 return False |
OLD | NEW |