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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 }) | 362 }) |
363 | 363 |
364 def generated_iterator_method(name): | 364 def generated_iterator_method(name): |
365 return generated_method( | 365 return generated_method( |
366 return_type=IdlType('Iterator'), | 366 return_type=IdlType('Iterator'), |
367 name=name, | 367 name=name, |
368 extended_attributes=used_extended_attributes) | 368 extended_attributes=used_extended_attributes) |
369 | 369 |
370 iterator_method = generated_iterator_method('iterator') | 370 iterator_method = generated_iterator_method('iterator') |
371 | 371 |
372 if interface.iterable: | 372 if interface.iterable or interface.maplike or interface.setlike: |
373 methods.extend([ | 373 methods.extend([ |
374 generated_iterator_method('keys'), | 374 generated_iterator_method('keys'), |
375 generated_iterator_method('values'), | 375 generated_iterator_method('values'), |
376 generated_iterator_method('entries'), | 376 generated_iterator_method('entries'), |
377 ]) | 377 ]) |
378 | 378 |
379 # FIXME: maplike<> and setlike<> should also imply the presence of a | 379 # FIXME: maplike<> and setlike<> should also imply the presence of a |
380 # subset of keys(), values(), entries(), forEach(), has(), get(), add(), | 380 # subset of keys(), values(), entries(), forEach(), has(), get(), add(), |
381 # set(), delete() and clear(), and a 'size' attribute. | 381 # set(), delete() and clear(), and a 'size' attribute. |
382 | 382 |
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 deleter = next( | 1310 deleter = next( |
1311 method | 1311 method |
1312 for method in interface.operations | 1312 for method in interface.operations |
1313 if ('deleter' in method.specials and | 1313 if ('deleter' in method.specials and |
1314 len(method.arguments) == 1 and | 1314 len(method.arguments) == 1 and |
1315 str(method.arguments[0].idl_type) == 'DOMString')) | 1315 str(method.arguments[0].idl_type) == 'DOMString')) |
1316 except StopIteration: | 1316 except StopIteration: |
1317 return None | 1317 return None |
1318 | 1318 |
1319 return property_deleter(deleter) | 1319 return property_deleter(deleter) |
OLD | NEW |