| OLD | NEW |
| 1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 'Int16Array', | 62 'Int16Array', |
| 63 'Int32Array', | 63 'Int32Array', |
| 64 'Uint8Array', | 64 'Uint8Array', |
| 65 'Uint8ClampedArray', | 65 'Uint8ClampedArray', |
| 66 'Uint16Array', | 66 'Uint16Array', |
| 67 'Uint32Array', | 67 'Uint32Array', |
| 68 ]) | 68 ]) |
| 69 ARRAY_BUFFER_AND_VIEW_TYPES = TYPED_ARRAY_TYPES.union(frozenset([ | 69 ARRAY_BUFFER_AND_VIEW_TYPES = TYPED_ARRAY_TYPES.union(frozenset([ |
| 70 'ArrayBuffer', | 70 'ArrayBuffer', |
| 71 'ArrayBufferView', | 71 'ArrayBufferView', |
| 72 'SharedArrayBuffer', |
| 72 'DataView', | 73 'DataView', |
| 73 ])) | 74 ])) |
| 74 | 75 |
| 76 |
| 75 IdlType.is_array_buffer_or_view = property( | 77 IdlType.is_array_buffer_or_view = property( |
| 76 lambda self: self.base_type in ARRAY_BUFFER_AND_VIEW_TYPES) | 78 lambda self: self.base_type in ARRAY_BUFFER_AND_VIEW_TYPES) |
| 77 | 79 |
| 78 IdlType.is_typed_array = property( | 80 IdlType.is_typed_array = property( |
| 79 lambda self: self.base_type in TYPED_ARRAY_TYPES) | 81 lambda self: self.base_type in TYPED_ARRAY_TYPES) |
| 80 | 82 |
| 81 IdlType.is_wrapper_type = property( | 83 IdlType.is_wrapper_type = property( |
| 82 lambda self: (self.is_interface_type and | 84 lambda self: (self.is_interface_type and |
| 83 not self.is_callback_interface and | 85 not self.is_callback_interface and |
| 84 self.base_type not in NON_WRAPPER_TYPES)) | 86 self.base_type not in NON_WRAPPER_TYPES)) |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 'unsigned short': 'toUInt16({isolate}, {arguments})', | 496 'unsigned short': 'toUInt16({isolate}, {arguments})', |
| 495 'long': 'toInt32({isolate}, {arguments})', | 497 'long': 'toInt32({isolate}, {arguments})', |
| 496 'unsigned long': 'toUInt32({isolate}, {arguments})', | 498 'unsigned long': 'toUInt32({isolate}, {arguments})', |
| 497 'long long': 'toInt64({isolate}, {arguments})', | 499 'long long': 'toInt64({isolate}, {arguments})', |
| 498 'unsigned long long': 'toUInt64({isolate}, {arguments})', | 500 'unsigned long long': 'toUInt64({isolate}, {arguments})', |
| 499 # Interface types | 501 # Interface types |
| 500 'Dictionary': 'Dictionary({v8_value}, {isolate}, exceptionState)', | 502 'Dictionary': 'Dictionary({v8_value}, {isolate}, exceptionState)', |
| 501 'EventTarget': 'toEventTarget({isolate}, {v8_value})', | 503 'EventTarget': 'toEventTarget({isolate}, {v8_value})', |
| 502 'NodeFilter': 'toNodeFilter({v8_value}, info.Holder(), ScriptState::current(
{isolate}))', | 504 'NodeFilter': 'toNodeFilter({v8_value}, info.Holder(), ScriptState::current(
{isolate}))', |
| 503 'Promise': 'ScriptPromise::cast(ScriptState::current({isolate}), {v8_value})
', | 505 'Promise': 'ScriptPromise::cast(ScriptState::current({isolate}), {v8_value})
', |
| 504 'SerializedScriptValue': 'SerializedScriptValueFactory::instance().create({i
solate}, {v8_value}, 0, 0, exceptionState)', | 506 'SerializedScriptValue': 'SerializedScriptValueFactory::instance().create({i
solate}, {v8_value}, 0, 0, 0, exceptionState)', |
| 505 'ScriptValue': 'ScriptValue(ScriptState::current({isolate}), {v8_value})', | 507 'ScriptValue': 'ScriptValue(ScriptState::current({isolate}), {v8_value})', |
| 506 'Window': 'toDOMWindow({isolate}, {v8_value})', | 508 'Window': 'toDOMWindow({isolate}, {v8_value})', |
| 507 'XPathNSResolver': 'toXPathNSResolver(ScriptState::current({isolate}), {v8_v
alue})', | 509 'XPathNSResolver': 'toXPathNSResolver(ScriptState::current({isolate}), {v8_v
alue})', |
| 508 } | 510 } |
| 509 | 511 |
| 510 | 512 |
| 511 def v8_conversion_needs_exception_state(idl_type): | 513 def v8_conversion_needs_exception_state(idl_type): |
| 512 return (idl_type.is_numeric_type or | 514 return (idl_type.is_numeric_type or |
| 513 idl_type.is_enum or | 515 idl_type.is_enum or |
| 514 idl_type.is_dictionary or | 516 idl_type.is_dictionary or |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 number_of_nullable_member_types_union) | 1005 number_of_nullable_member_types_union) |
| 1004 | 1006 |
| 1005 | 1007 |
| 1006 def includes_nullable_type_union(idl_type): | 1008 def includes_nullable_type_union(idl_type): |
| 1007 # http://heycam.github.io/webidl/#dfn-includes-a-nullable-type | 1009 # http://heycam.github.io/webidl/#dfn-includes-a-nullable-type |
| 1008 return idl_type.number_of_nullable_member_types == 1 | 1010 return idl_type.number_of_nullable_member_types == 1 |
| 1009 | 1011 |
| 1010 IdlTypeBase.includes_nullable_type = False | 1012 IdlTypeBase.includes_nullable_type = False |
| 1011 IdlNullableType.includes_nullable_type = True | 1013 IdlNullableType.includes_nullable_type = True |
| 1012 IdlUnionType.includes_nullable_type = property(includes_nullable_type_union) | 1014 IdlUnionType.includes_nullable_type = property(includes_nullable_type_union) |
| OLD | NEW |