| OLD | NEW |
| 1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
| 2 # coding=utf-8 | 2 # coding=utf-8 |
| 3 # | 3 # |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 'CallWith': ['ScriptState', 'ThisValue'], | 419 'CallWith': ['ScriptState', 'ThisValue'], |
| 420 }) | 420 }) |
| 421 | 421 |
| 422 def generated_iterator_method(name, implemented_as=None): | 422 def generated_iterator_method(name, implemented_as=None): |
| 423 return generated_method( | 423 return generated_method( |
| 424 return_type=IdlType('Iterator'), | 424 return_type=IdlType('Iterator'), |
| 425 name=name, | 425 name=name, |
| 426 extended_attributes=used_extended_attributes, | 426 extended_attributes=used_extended_attributes, |
| 427 implemented_as=implemented_as) | 427 implemented_as=implemented_as) |
| 428 | 428 |
| 429 if interface.iterable or interface.maplike or interface.setlike or 'Iter
able' in extended_attributes: | 429 if interface.has_indexed_elements: |
| 430 # Window.idl in Blink has indexed properties, but the spec says |
| 431 # Window interface doesn't have indexed properties, instead |
| 432 # the WindowProxy exotic object has indexed properties. Thus, |
| 433 # Window interface must not support iterators. |
| 434 has_array_iterator = (interface.name != 'Window') |
| 435 elif interface.iterable or interface.maplike or interface.setlike or 'It
erable' in extended_attributes: |
| 430 iterator_method = generated_iterator_method('iterator', implemented_
as='iterator') | 436 iterator_method = generated_iterator_method('iterator', implemented_
as='iterator') |
| 431 elif interface.has_indexed_elements: | |
| 432 has_array_iterator = True | |
| 433 | 437 |
| 434 if interface.iterable or interface.maplike or interface.setlike: | 438 if interface.iterable or interface.maplike or interface.setlike: |
| 435 implicit_methods = [ | 439 implicit_methods = [ |
| 436 generated_iterator_method('keys'), | 440 generated_iterator_method('keys'), |
| 437 generated_iterator_method('values'), | 441 generated_iterator_method('values'), |
| 438 generated_iterator_method('entries'), | 442 generated_iterator_method('entries'), |
| 439 | 443 |
| 440 # void forEach(Function callback, [Default=Undefined] optional a
ny thisArg) | 444 # void forEach(Function callback, [Default=Undefined] optional a
ny thisArg) |
| 441 generated_method(IdlType('void'), 'forEach', | 445 generated_method(IdlType('void'), 'forEach', |
| 442 arguments=[generated_argument(IdlType('Function
'), 'callback'), | 446 arguments=[generated_argument(IdlType('Function
'), 'callback'), |
| (...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1404 extended_attributes = deleter.extended_attributes | 1408 extended_attributes = deleter.extended_attributes |
| 1405 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete
r, 'CallWith', 'ScriptState') | 1409 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete
r, 'CallWith', 'ScriptState') |
| 1406 is_ce_reactions = 'CEReactions' in extended_attributes | 1410 is_ce_reactions = 'CEReactions' in extended_attributes |
| 1407 return { | 1411 return { |
| 1408 'is_call_with_script_state': is_call_with_script_state, | 1412 'is_call_with_script_state': is_call_with_script_state, |
| 1409 'is_ce_reactions': is_ce_reactions, | 1413 'is_ce_reactions': is_ce_reactions, |
| 1410 'is_custom': 'Custom' in extended_attributes, | 1414 'is_custom': 'Custom' in extended_attributes, |
| 1411 'is_raises_exception': 'RaisesException' in extended_attributes, | 1415 'is_raises_exception': 'RaisesException' in extended_attributes, |
| 1412 'name': cpp_name(deleter), | 1416 'name': cpp_name(deleter), |
| 1413 } | 1417 } |
| OLD | NEW |