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 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 'unsigned short': 'toUInt16({arguments})', | 455 'unsigned short': 'toUInt16({arguments})', |
456 'long': 'toInt32({arguments})', | 456 'long': 'toInt32({arguments})', |
457 'unsigned long': 'toUInt32({arguments})', | 457 'unsigned long': 'toUInt32({arguments})', |
458 'long long': 'toInt64({arguments})', | 458 'long long': 'toInt64({arguments})', |
459 'unsigned long long': 'toUInt64({arguments})', | 459 'unsigned long long': 'toUInt64({arguments})', |
460 # Interface types | 460 # Interface types |
461 'Dictionary': 'Dictionary({v8_value}, {isolate})', | 461 'Dictionary': 'Dictionary({v8_value}, {isolate})', |
462 'EventTarget': 'V8DOMWrapper::isDOMWrapper({v8_value}) ? toWrapperTypeInfo(v
8::Handle<v8::Object>::Cast({v8_value}))->toEventTarget(v8::Handle<v8::Object>::
Cast({v8_value})) : 0', | 462 'EventTarget': 'V8DOMWrapper::isDOMWrapper({v8_value}) ? toWrapperTypeInfo(v
8::Handle<v8::Object>::Cast({v8_value}))->toEventTarget(v8::Handle<v8::Object>::
Cast({v8_value})) : 0', |
463 'NodeFilter': 'toNodeFilter({v8_value}, info.Holder(), ScriptState::current(
{isolate}))', | 463 'NodeFilter': 'toNodeFilter({v8_value}, info.Holder(), ScriptState::current(
{isolate}))', |
464 'Promise': 'ScriptPromise::cast(ScriptState::current({isolate}), {v8_value})
', | 464 'Promise': 'ScriptPromise::cast(ScriptState::current({isolate}), {v8_value})
', |
465 'SerializedScriptValue': 'SerializedScriptValue::create({v8_value}, {isolate
})', | 465 'SerializedScriptValue': 'SerializedScriptValue::create({v8_value}, 0, 0, ex
ceptionState, {isolate})', |
466 'ScriptValue': 'ScriptValue(ScriptState::current({isolate}), {v8_value})', | 466 'ScriptValue': 'ScriptValue(ScriptState::current({isolate}), {v8_value})', |
467 'Window': 'toDOMWindow({v8_value}, {isolate})', | 467 'Window': 'toDOMWindow({v8_value}, {isolate})', |
468 'XPathNSResolver': 'toXPathNSResolver({v8_value}, {isolate})', | 468 'XPathNSResolver': 'toXPathNSResolver({v8_value}, {isolate})', |
469 } | 469 } |
470 | 470 |
471 | 471 |
472 def v8_conversion_needs_exception_state(idl_type): | 472 def v8_conversion_needs_exception_state(idl_type): |
473 return (idl_type.is_numeric_type or | 473 return (idl_type.is_numeric_type or |
474 idl_type.is_dictionary or | 474 idl_type.is_dictionary or |
475 idl_type.name in ('ByteString', 'ScalarValueString')) | 475 idl_type.name in ('ByteString', 'ScalarValueString', 'SerializedScri
ptValue')) |
476 | 476 |
477 IdlType.v8_conversion_needs_exception_state = property(v8_conversion_needs_excep
tion_state) | 477 IdlType.v8_conversion_needs_exception_state = property(v8_conversion_needs_excep
tion_state) |
478 | 478 |
479 | 479 |
480 def v8_conversion_is_trivial(idl_type): | 480 def v8_conversion_is_trivial(idl_type): |
481 # The conversion is a simple expression that returns the converted value and | 481 # The conversion is a simple expression that returns the converted value and |
482 # cannot raise an exception. | 482 # cannot raise an exception. |
483 return (idl_type.base_type == 'boolean' or | 483 return (idl_type.base_type == 'boolean' or |
484 idl_type.base_type == 'Dictionary' or | 484 idl_type.base_type == 'Dictionary' or |
485 idl_type.is_wrapper_type) | 485 idl_type.is_wrapper_type) |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 | 834 |
835 | 835 |
836 def is_explicit_nullable(idl_type): | 836 def is_explicit_nullable(idl_type): |
837 # Nullable type that isn't implicit nullable (see above.) For such types, | 837 # Nullable type that isn't implicit nullable (see above.) For such types, |
838 # we use Nullable<T> or similar explicit ways to represent a null value. | 838 # we use Nullable<T> or similar explicit ways to represent a null value. |
839 return idl_type.is_nullable and not idl_type.is_implicit_nullable | 839 return idl_type.is_nullable and not idl_type.is_implicit_nullable |
840 | 840 |
841 IdlTypeBase.is_implicit_nullable = property(is_implicit_nullable) | 841 IdlTypeBase.is_implicit_nullable = property(is_implicit_nullable) |
842 IdlUnionType.is_implicit_nullable = False | 842 IdlUnionType.is_implicit_nullable = False |
843 IdlTypeBase.is_explicit_nullable = property(is_explicit_nullable) | 843 IdlTypeBase.is_explicit_nullable = property(is_explicit_nullable) |
OLD | NEW |