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 if interface.name != 'Window': | |
435 has_array_iterator = True | |
peria
2016/09/15 12:06:43
nit: has_array_iterator = (interface.name != 'Wind
Yuki
2016/09/15 12:35:47
Done.
| |
436 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') | 437 iterator_method = generated_iterator_method('iterator', implemented_ as='iterator') |
431 elif interface.has_indexed_elements: | |
432 has_array_iterator = True | |
433 | 438 |
434 if interface.iterable or interface.maplike or interface.setlike: | 439 if interface.iterable or interface.maplike or interface.setlike: |
435 implicit_methods = [ | 440 implicit_methods = [ |
436 generated_iterator_method('keys'), | 441 generated_iterator_method('keys'), |
437 generated_iterator_method('values'), | 442 generated_iterator_method('values'), |
438 generated_iterator_method('entries'), | 443 generated_iterator_method('entries'), |
439 | 444 |
440 # void forEach(Function callback, [Default=Undefined] optional a ny thisArg) | 445 # void forEach(Function callback, [Default=Undefined] optional a ny thisArg) |
441 generated_method(IdlType('void'), 'forEach', | 446 generated_method(IdlType('void'), 'forEach', |
442 arguments=[generated_argument(IdlType('Function '), 'callback'), | 447 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 | 1409 extended_attributes = deleter.extended_attributes |
1405 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState') | 1410 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState') |
1406 is_ce_reactions = 'CEReactions' in extended_attributes | 1411 is_ce_reactions = 'CEReactions' in extended_attributes |
1407 return { | 1412 return { |
1408 'is_call_with_script_state': is_call_with_script_state, | 1413 'is_call_with_script_state': is_call_with_script_state, |
1409 'is_ce_reactions': is_ce_reactions, | 1414 'is_ce_reactions': is_ce_reactions, |
1410 'is_custom': 'Custom' in extended_attributes, | 1415 'is_custom': 'Custom' in extended_attributes, |
1411 'is_raises_exception': 'RaisesException' in extended_attributes, | 1416 'is_raises_exception': 'RaisesException' in extended_attributes, |
1412 'name': cpp_name(deleter), | 1417 'name': cpp_name(deleter), |
1413 } | 1418 } |
OLD | NEW |