OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! | 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! |
6 | 6 |
7 #include "config.h" | 7 #include "config.h" |
8 #include "V8TestDictionaryDerived.h" | 8 #include "V8TestDictionaryDerived.h" |
9 | 9 |
10 #include "bindings/core/v8/ExceptionState.h" | 10 #include "bindings/core/v8/ExceptionState.h" |
11 #include "bindings/core/v8/V8TestDictionary.h" | 11 #include "bindings/core/v8/V8TestDictionary.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 void V8TestDictionaryDerivedImplementedAs::toImpl(v8::Isolate* isolate, v8::Loca
l<v8::Value> v8Value, TestDictionaryDerivedImplementedAs& impl, ExceptionState&
exceptionState) | 15 bool V8TestDictionaryDerivedImplementedAs::toImpl(v8::Isolate* isolate, v8::Loca
l<v8::Value> v8Value, TestDictionaryDerivedImplementedAs& impl, ExceptionState&
exceptionState) |
16 { | 16 { |
17 if (isUndefinedOrNull(v8Value)) | 17 if (isUndefinedOrNull(v8Value)) |
18 return; | 18 return true; |
19 if (!v8Value->IsObject()) { | 19 if (!v8Value->IsObject()) { |
20 exceptionState.throwTypeError("cannot convert to dictionary."); | 20 exceptionState.throwTypeError("cannot convert to dictionary."); |
21 return; | 21 return false; |
22 } | 22 } |
23 | 23 |
24 V8TestDictionary::toImpl(isolate, v8Value, impl, exceptionState); | 24 if (!V8TestDictionary::toImpl(isolate, v8Value, impl, exceptionState)) |
25 if (exceptionState.hadException()) | 25 return false; |
26 return; | |
27 | 26 |
28 v8::Local<v8::Object> v8Object = v8Value->ToObject(isolate); | 27 v8::Local<v8::Object> v8Object = v8Value->ToObject(isolate); |
29 v8::TryCatch block; | 28 v8::TryCatch block; |
30 v8::Local<v8::Value> derivedStringMemberValue = v8Object->Get(v8String(isola
te, "derivedStringMember")); | 29 v8::Local<v8::Value> derivedStringMemberValue = v8Object->Get(v8String(isola
te, "derivedStringMember")); |
31 if (block.HasCaught()) { | 30 if (block.HasCaught()) { |
32 exceptionState.rethrowV8Exception(block.Exception()); | 31 exceptionState.rethrowV8Exception(block.Exception()); |
33 return; | 32 return false; |
34 } | 33 } |
35 if (derivedStringMemberValue.IsEmpty() || derivedStringMemberValue->IsUndefi
ned()) { | 34 if (derivedStringMemberValue.IsEmpty() || derivedStringMemberValue->IsUndefi
ned()) { |
36 // Do nothing. | 35 // Do nothing. |
37 } else { | 36 } else { |
38 TOSTRING_VOID(V8StringResource<>, derivedStringMember, derivedStringMemb
erValue); | 37 V8StringResource<> derivedStringMember = derivedStringMemberValue; |
| 38 if (!derivedStringMember.prepare(exceptionState)) |
| 39 return false; |
39 impl.setDerivedStringMember(derivedStringMember); | 40 impl.setDerivedStringMember(derivedStringMember); |
40 } | 41 } |
41 | 42 |
42 v8::Local<v8::Value> derivedStringMemberWithDefaultValue = v8Object->Get(v8S
tring(isolate, "derivedStringMemberWithDefault")); | 43 v8::Local<v8::Value> derivedStringMemberWithDefaultValue = v8Object->Get(v8S
tring(isolate, "derivedStringMemberWithDefault")); |
43 if (block.HasCaught()) { | 44 if (block.HasCaught()) { |
44 exceptionState.rethrowV8Exception(block.Exception()); | 45 exceptionState.rethrowV8Exception(block.Exception()); |
45 return; | 46 return false; |
46 } | 47 } |
47 if (derivedStringMemberWithDefaultValue.IsEmpty() || derivedStringMemberWith
DefaultValue->IsUndefined()) { | 48 if (derivedStringMemberWithDefaultValue.IsEmpty() || derivedStringMemberWith
DefaultValue->IsUndefined()) { |
48 // Do nothing. | 49 // Do nothing. |
49 } else { | 50 } else { |
50 TOSTRING_VOID(V8StringResource<>, derivedStringMemberWithDefault, derive
dStringMemberWithDefaultValue); | 51 V8StringResource<> derivedStringMemberWithDefault = derivedStringMemberW
ithDefaultValue; |
| 52 if (!derivedStringMemberWithDefault.prepare(exceptionState)) |
| 53 return false; |
51 impl.setDerivedStringMemberWithDefault(derivedStringMemberWithDefault); | 54 impl.setDerivedStringMemberWithDefault(derivedStringMemberWithDefault); |
52 } | 55 } |
53 | 56 |
| 57 return true; |
54 } | 58 } |
55 | 59 |
56 v8::Local<v8::Value> toV8(const TestDictionaryDerivedImplementedAs& impl, v8::Lo
cal<v8::Object> creationContext, v8::Isolate* isolate) | 60 v8::Local<v8::Value> toV8(const TestDictionaryDerivedImplementedAs& impl, v8::Lo
cal<v8::Object> creationContext, v8::Isolate* isolate) |
57 { | 61 { |
58 v8::Local<v8::Object> v8Object = v8::Object::New(isolate); | 62 v8::Local<v8::Object> v8Object = v8::Object::New(isolate); |
59 toV8TestDictionary(impl, v8Object, creationContext, isolate); | 63 toV8TestDictionary(impl, v8Object, creationContext, isolate); |
60 toV8TestDictionaryDerivedImplementedAs(impl, v8Object, creationContext, isol
ate); | 64 toV8TestDictionaryDerivedImplementedAs(impl, v8Object, creationContext, isol
ate); |
61 return v8Object; | 65 return v8Object; |
62 } | 66 } |
63 | 67 |
(...skipping 12 matching lines...) Expand all Loading... |
76 } | 80 } |
77 | 81 |
78 TestDictionaryDerivedImplementedAs NativeValueTraits<TestDictionaryDerivedImplem
entedAs>::nativeValue(const v8::Local<v8::Value>& value, v8::Isolate* isolate, E
xceptionState& exceptionState) | 82 TestDictionaryDerivedImplementedAs NativeValueTraits<TestDictionaryDerivedImplem
entedAs>::nativeValue(const v8::Local<v8::Value>& value, v8::Isolate* isolate, E
xceptionState& exceptionState) |
79 { | 83 { |
80 TestDictionaryDerivedImplementedAs impl; | 84 TestDictionaryDerivedImplementedAs impl; |
81 V8TestDictionaryDerivedImplementedAs::toImpl(isolate, value, impl, exception
State); | 85 V8TestDictionaryDerivedImplementedAs::toImpl(isolate, value, impl, exception
State); |
82 return impl; | 86 return impl; |
83 } | 87 } |
84 | 88 |
85 } // namespace blink | 89 } // namespace blink |
OLD | NEW |