Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(451)

Side by Side Diff: Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp

Issue 938733003: IDL: Fix exception handling when converting V8 value to union/dictionary (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 17 matching lines...) Expand all
28 v8::Local<v8::Object> v8Object = v8Value->ToObject(isolate); 28 v8::Local<v8::Object> v8Object = v8Value->ToObject(isolate);
29 v8::TryCatch block; 29 v8::TryCatch block;
30 v8::Local<v8::Value> derivedStringMemberValue = v8Object->Get(v8String(isola te, "derivedStringMember")); 30 v8::Local<v8::Value> derivedStringMemberValue = v8Object->Get(v8String(isola te, "derivedStringMember"));
31 if (block.HasCaught()) { 31 if (block.HasCaught()) {
32 exceptionState.rethrowV8Exception(block.Exception()); 32 exceptionState.rethrowV8Exception(block.Exception());
33 return; 33 return;
34 } 34 }
35 if (derivedStringMemberValue.IsEmpty() || derivedStringMemberValue->IsUndefi ned()) { 35 if (derivedStringMemberValue.IsEmpty() || derivedStringMemberValue->IsUndefi ned()) {
36 // Do nothing. 36 // Do nothing.
37 } else { 37 } else {
38 TOSTRING_VOID(V8StringResource<>, derivedStringMember, derivedStringMemb erValue); 38 TOSTRING_VOID_EXCEPTIONSTATE(V8StringResource<>, derivedStringMember, de rivedStringMemberValue, exceptionState);
39 impl.setDerivedStringMember(derivedStringMember); 39 impl.setDerivedStringMember(derivedStringMember);
40 } 40 }
41 41
42 v8::Local<v8::Value> derivedStringMemberWithDefaultValue = v8Object->Get(v8S tring(isolate, "derivedStringMemberWithDefault")); 42 v8::Local<v8::Value> derivedStringMemberWithDefaultValue = v8Object->Get(v8S tring(isolate, "derivedStringMemberWithDefault"));
43 if (block.HasCaught()) { 43 if (block.HasCaught()) {
44 exceptionState.rethrowV8Exception(block.Exception()); 44 exceptionState.rethrowV8Exception(block.Exception());
45 return; 45 return;
46 } 46 }
47 if (derivedStringMemberWithDefaultValue.IsEmpty() || derivedStringMemberWith DefaultValue->IsUndefined()) { 47 if (derivedStringMemberWithDefaultValue.IsEmpty() || derivedStringMemberWith DefaultValue->IsUndefined()) {
48 // Do nothing. 48 // Do nothing.
49 } else { 49 } else {
50 TOSTRING_VOID(V8StringResource<>, derivedStringMemberWithDefault, derive dStringMemberWithDefaultValue); 50 TOSTRING_VOID_EXCEPTIONSTATE(V8StringResource<>, derivedStringMemberWith Default, derivedStringMemberWithDefaultValue, exceptionState);
51 impl.setDerivedStringMemberWithDefault(derivedStringMemberWithDefault); 51 impl.setDerivedStringMemberWithDefault(derivedStringMemberWithDefault);
52 } 52 }
53 53
54 } 54 }
55 55
56 v8::Local<v8::Value> toV8(const TestDictionaryDerivedImplementedAs& impl, v8::Lo cal<v8::Object> creationContext, v8::Isolate* isolate) 56 v8::Local<v8::Value> toV8(const TestDictionaryDerivedImplementedAs& impl, v8::Lo cal<v8::Object> creationContext, v8::Isolate* isolate)
57 { 57 {
58 v8::Local<v8::Object> v8Object = v8::Object::New(isolate); 58 v8::Local<v8::Object> v8Object = v8::Object::New(isolate);
59 toV8TestDictionary(impl, v8Object, creationContext, isolate); 59 toV8TestDictionary(impl, v8Object, creationContext, isolate);
60 toV8TestDictionaryDerivedImplementedAs(impl, v8Object, creationContext, isol ate); 60 toV8TestDictionaryDerivedImplementedAs(impl, v8Object, creationContext, isol ate);
(...skipping 15 matching lines...) Expand all
76 } 76 }
77 77
78 TestDictionaryDerivedImplementedAs NativeValueTraits<TestDictionaryDerivedImplem entedAs>::nativeValue(const v8::Local<v8::Value>& value, v8::Isolate* isolate, E xceptionState& exceptionState) 78 TestDictionaryDerivedImplementedAs NativeValueTraits<TestDictionaryDerivedImplem entedAs>::nativeValue(const v8::Local<v8::Value>& value, v8::Isolate* isolate, E xceptionState& exceptionState)
79 { 79 {
80 TestDictionaryDerivedImplementedAs impl; 80 TestDictionaryDerivedImplementedAs impl;
81 V8TestDictionaryDerivedImplementedAs::toImpl(isolate, value, impl, exception State); 81 V8TestDictionaryDerivedImplementedAs::toImpl(isolate, value, impl, exception State);
82 return impl; 82 return impl;
83 } 83 }
84 84
85 } // namespace blink 85 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698