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

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

Issue 1051753003: bindings: Add toBoolean() to V8Binding.h (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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 "V8TestDictionary.h" 8 #include "V8TestDictionary.h"
9 9
10 #include "bindings/core/v8/ExceptionState.h" 10 #include "bindings/core/v8/ExceptionState.h"
(...skipping 23 matching lines...) Expand all
34 v8::Local<v8::Object> v8Object = v8Value->ToObject(isolate); 34 v8::Local<v8::Object> v8Object = v8Value->ToObject(isolate);
35 v8::TryCatch block; 35 v8::TryCatch block;
36 v8::Local<v8::Value> booleanMemberValue = v8Object->Get(v8String(isolate, "b ooleanMember")); 36 v8::Local<v8::Value> booleanMemberValue = v8Object->Get(v8String(isolate, "b ooleanMember"));
37 if (block.HasCaught()) { 37 if (block.HasCaught()) {
38 exceptionState.rethrowV8Exception(block.Exception()); 38 exceptionState.rethrowV8Exception(block.Exception());
39 return; 39 return;
40 } 40 }
41 if (booleanMemberValue.IsEmpty() || booleanMemberValue->IsUndefined()) { 41 if (booleanMemberValue.IsEmpty() || booleanMemberValue->IsUndefined()) {
42 // Do nothing. 42 // Do nothing.
43 } else { 43 } else {
44 bool booleanMember = booleanMemberValue->BooleanValue(); 44 bool booleanMember = toBoolean(isolate, booleanMemberValue, exceptionSta te);
45 if (exceptionState.hadException())
46 return;
45 impl.setBooleanMember(booleanMember); 47 impl.setBooleanMember(booleanMember);
46 } 48 }
47 49
48 v8::Local<v8::Value> createValue = v8Object->Get(v8String(isolate, "create") ); 50 v8::Local<v8::Value> createValue = v8Object->Get(v8String(isolate, "create") );
49 if (block.HasCaught()) { 51 if (block.HasCaught()) {
50 exceptionState.rethrowV8Exception(block.Exception()); 52 exceptionState.rethrowV8Exception(block.Exception());
51 return; 53 return;
52 } 54 }
53 if (createValue.IsEmpty() || createValue->IsUndefined()) { 55 if (createValue.IsEmpty() || createValue->IsUndefined()) {
54 // Do nothing. 56 // Do nothing.
55 } else { 57 } else {
56 bool create = createValue->BooleanValue(); 58 bool create = toBoolean(isolate, createValue, exceptionState);
59 if (exceptionState.hadException())
60 return;
57 impl.setCreateMember(create); 61 impl.setCreateMember(create);
58 } 62 }
59 63
60 v8::Local<v8::Value> deprecatedCreateMemberValue = v8Object->Get(v8String(is olate, "deprecatedCreateMember")); 64 v8::Local<v8::Value> deprecatedCreateMemberValue = v8Object->Get(v8String(is olate, "deprecatedCreateMember"));
61 if (block.HasCaught()) { 65 if (block.HasCaught()) {
62 exceptionState.rethrowV8Exception(block.Exception()); 66 exceptionState.rethrowV8Exception(block.Exception());
63 return; 67 return;
64 } 68 }
65 if (deprecatedCreateMemberValue.IsEmpty() || deprecatedCreateMemberValue->Is Undefined()) { 69 if (deprecatedCreateMemberValue.IsEmpty() || deprecatedCreateMemberValue->Is Undefined()) {
66 // Do nothing. 70 // Do nothing.
67 } else { 71 } else {
68 UseCounter::countDeprecationIfNotPrivateScript(isolate, callingExecution Context(isolate), UseCounter::CreateMember); 72 UseCounter::countDeprecationIfNotPrivateScript(isolate, callingExecution Context(isolate), UseCounter::CreateMember);
69 bool deprecatedCreateMember = deprecatedCreateMemberValue->BooleanValue( ); 73 bool deprecatedCreateMember = toBoolean(isolate, deprecatedCreateMemberV alue, exceptionState);
74 if (exceptionState.hadException())
75 return;
70 impl.setCreateMember(deprecatedCreateMember); 76 impl.setCreateMember(deprecatedCreateMember);
71 } 77 }
72 78
73 v8::Local<v8::Value> doubleOrNullMemberValue = v8Object->Get(v8String(isolat e, "doubleOrNullMember")); 79 v8::Local<v8::Value> doubleOrNullMemberValue = v8Object->Get(v8String(isolat e, "doubleOrNullMember"));
74 if (block.HasCaught()) { 80 if (block.HasCaught()) {
75 exceptionState.rethrowV8Exception(block.Exception()); 81 exceptionState.rethrowV8Exception(block.Exception());
76 return; 82 return;
77 } 83 }
78 if (doubleOrNullMemberValue.IsEmpty() || doubleOrNullMemberValue->IsUndefine d()) { 84 if (doubleOrNullMemberValue.IsEmpty() || doubleOrNullMemberValue->IsUndefine d()) {
79 // Do nothing. 85 // Do nothing.
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 } 625 }
620 626
621 TestDictionary NativeValueTraits<TestDictionary>::nativeValue(v8::Isolate* isola te, v8::Local<v8::Value> value, ExceptionState& exceptionState) 627 TestDictionary NativeValueTraits<TestDictionary>::nativeValue(v8::Isolate* isola te, v8::Local<v8::Value> value, ExceptionState& exceptionState)
622 { 628 {
623 TestDictionary impl; 629 TestDictionary impl;
624 V8TestDictionary::toImpl(isolate, value, impl, exceptionState); 630 V8TestDictionary::toImpl(isolate, value, impl, exceptionState);
625 return impl; 631 return impl;
626 } 632 }
627 633
628 } // namespace blink 634 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698