| 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" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 v8::Local<v8::Object> v8Object = v8::Object::New(isolate); | 87 v8::Local<v8::Object> v8Object = v8::Object::New(isolate); |
| 88 if (!toV8TestDictionary(impl, v8Object, creationContext, isolate)) | 88 if (!toV8TestDictionary(impl, v8Object, creationContext, isolate)) |
| 89 return v8::Local<v8::Value>(); | 89 return v8::Local<v8::Value>(); |
| 90 if (!toV8TestDictionaryDerivedImplementedAs(impl, v8Object, creationContext,
isolate)) | 90 if (!toV8TestDictionaryDerivedImplementedAs(impl, v8Object, creationContext,
isolate)) |
| 91 return v8::Local<v8::Value>(); | 91 return v8::Local<v8::Value>(); |
| 92 return v8Object; | 92 return v8Object; |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool toV8TestDictionaryDerivedImplementedAs(const TestDictionaryDerivedImplement
edAs& impl, v8::Local<v8::Object> dictionary, v8::Local<v8::Object> creationCont
ext, v8::Isolate* isolate) | 95 bool toV8TestDictionaryDerivedImplementedAs(const TestDictionaryDerivedImplement
edAs& impl, v8::Local<v8::Object> dictionary, v8::Local<v8::Object> creationCont
ext, v8::Isolate* isolate) |
| 96 { | 96 { |
| 97 // TODO(bashi): Use ForceSet() instead of Set(). http://crbug.com/476720 | |
| 98 if (impl.hasDerivedStringMember()) { | 97 if (impl.hasDerivedStringMember()) { |
| 99 if (!v8CallBoolean(dictionary->Set(isolate->GetCurrentContext(), v8Strin
g(isolate, "derivedStringMember"), v8String(isolate, impl.derivedStringMember())
))) | 98 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentCon
text(), v8String(isolate, "derivedStringMember"), v8String(isolate, impl.derived
StringMember())))) |
| 100 return false; | 99 return false; |
| 101 } | 100 } |
| 102 | 101 |
| 103 if (impl.hasDerivedStringMemberWithDefault()) { | 102 if (impl.hasDerivedStringMemberWithDefault()) { |
| 104 if (!v8CallBoolean(dictionary->Set(isolate->GetCurrentContext(), v8Strin
g(isolate, "derivedStringMemberWithDefault"), v8String(isolate, impl.derivedStri
ngMemberWithDefault())))) | 103 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentCon
text(), v8String(isolate, "derivedStringMemberWithDefault"), v8String(isolate, i
mpl.derivedStringMemberWithDefault())))) |
| 105 return false; | 104 return false; |
| 106 } else { | 105 } else { |
| 107 if (!v8CallBoolean(dictionary->Set(isolate->GetCurrentContext(), v8Strin
g(isolate, "derivedStringMemberWithDefault"), v8String(isolate, String("default
string value"))))) | 106 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentCon
text(), v8String(isolate, "derivedStringMemberWithDefault"), v8String(isolate, S
tring("default string value"))))) |
| 108 return false; | 107 return false; |
| 109 } | 108 } |
| 110 | 109 |
| 111 if (impl.hasRequiredLongMember()) { | 110 if (impl.hasRequiredLongMember()) { |
| 112 if (!v8CallBoolean(dictionary->Set(isolate->GetCurrentContext(), v8Strin
g(isolate, "requiredLongMember"), v8::Integer::New(isolate, impl.requiredLongMem
ber())))) | 111 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentCon
text(), v8String(isolate, "requiredLongMember"), v8::Integer::New(isolate, impl.
requiredLongMember())))) |
| 113 return false; | 112 return false; |
| 114 } else { | 113 } else { |
| 115 ASSERT_NOT_REACHED(); | 114 ASSERT_NOT_REACHED(); |
| 116 } | 115 } |
| 117 | 116 |
| 118 return true; | 117 return true; |
| 119 } | 118 } |
| 120 | 119 |
| 121 TestDictionaryDerivedImplementedAs NativeValueTraits<TestDictionaryDerivedImplem
entedAs>::nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, Exceptio
nState& exceptionState) | 120 TestDictionaryDerivedImplementedAs NativeValueTraits<TestDictionaryDerivedImplem
entedAs>::nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, Exceptio
nState& exceptionState) |
| 122 { | 121 { |
| 123 TestDictionaryDerivedImplementedAs impl; | 122 TestDictionaryDerivedImplementedAs impl; |
| 124 V8TestDictionaryDerivedImplementedAs::toImpl(isolate, value, impl, exception
State); | 123 V8TestDictionaryDerivedImplementedAs::toImpl(isolate, value, impl, exception
State); |
| 125 return impl; | 124 return impl; |
| 126 } | 125 } |
| 127 | 126 |
| 128 } // namespace blink | 127 } // namespace blink |
| OLD | NEW |