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

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 27 matching lines...) Expand all
38 return; 38 return;
39 } 39 }
40 v8::Local<v8::Value> booleanMemberValue = v8Object->Get(v8String(isolate, "b ooleanMember")); 40 v8::Local<v8::Value> booleanMemberValue = v8Object->Get(v8String(isolate, "b ooleanMember"));
41 if (block.HasCaught()) { 41 if (block.HasCaught()) {
42 exceptionState.rethrowV8Exception(block.Exception()); 42 exceptionState.rethrowV8Exception(block.Exception());
43 return; 43 return;
44 } 44 }
45 if (booleanMemberValue.IsEmpty() || booleanMemberValue->IsUndefined()) { 45 if (booleanMemberValue.IsEmpty() || booleanMemberValue->IsUndefined()) {
46 // Do nothing. 46 // Do nothing.
47 } else { 47 } else {
48 bool booleanMember = booleanMemberValue->BooleanValue(); 48 bool booleanMember = toBoolean(isolate, booleanMemberValue, exceptionSta te);
49 if (exceptionState.hadException())
50 return;
49 impl.setBooleanMember(booleanMember); 51 impl.setBooleanMember(booleanMember);
50 } 52 }
51 53
52 v8::Local<v8::Value> createValue = v8Object->Get(v8String(isolate, "create") ); 54 v8::Local<v8::Value> createValue = v8Object->Get(v8String(isolate, "create") );
53 if (block.HasCaught()) { 55 if (block.HasCaught()) {
54 exceptionState.rethrowV8Exception(block.Exception()); 56 exceptionState.rethrowV8Exception(block.Exception());
55 return; 57 return;
56 } 58 }
57 if (createValue.IsEmpty() || createValue->IsUndefined()) { 59 if (createValue.IsEmpty() || createValue->IsUndefined()) {
58 // Do nothing. 60 // Do nothing.
59 } else { 61 } else {
60 bool create = createValue->BooleanValue(); 62 bool create = toBoolean(isolate, createValue, exceptionState);
63 if (exceptionState.hadException())
64 return;
61 impl.setCreateMember(create); 65 impl.setCreateMember(create);
62 } 66 }
63 67
64 v8::Local<v8::Value> deprecatedCreateMemberValue = v8Object->Get(v8String(is olate, "deprecatedCreateMember")); 68 v8::Local<v8::Value> deprecatedCreateMemberValue = v8Object->Get(v8String(is olate, "deprecatedCreateMember"));
65 if (block.HasCaught()) { 69 if (block.HasCaught()) {
66 exceptionState.rethrowV8Exception(block.Exception()); 70 exceptionState.rethrowV8Exception(block.Exception());
67 return; 71 return;
68 } 72 }
69 if (deprecatedCreateMemberValue.IsEmpty() || deprecatedCreateMemberValue->Is Undefined()) { 73 if (deprecatedCreateMemberValue.IsEmpty() || deprecatedCreateMemberValue->Is Undefined()) {
70 // Do nothing. 74 // Do nothing.
71 } else { 75 } else {
72 UseCounter::countDeprecationIfNotPrivateScript(isolate, callingExecution Context(isolate), UseCounter::CreateMember); 76 UseCounter::countDeprecationIfNotPrivateScript(isolate, callingExecution Context(isolate), UseCounter::CreateMember);
73 bool deprecatedCreateMember = deprecatedCreateMemberValue->BooleanValue( ); 77 bool deprecatedCreateMember = toBoolean(isolate, deprecatedCreateMemberV alue, exceptionState);
78 if (exceptionState.hadException())
79 return;
74 impl.setCreateMember(deprecatedCreateMember); 80 impl.setCreateMember(deprecatedCreateMember);
75 } 81 }
76 82
77 v8::Local<v8::Value> doubleOrNullMemberValue = v8Object->Get(v8String(isolat e, "doubleOrNullMember")); 83 v8::Local<v8::Value> doubleOrNullMemberValue = v8Object->Get(v8String(isolat e, "doubleOrNullMember"));
78 if (block.HasCaught()) { 84 if (block.HasCaught()) {
79 exceptionState.rethrowV8Exception(block.Exception()); 85 exceptionState.rethrowV8Exception(block.Exception());
80 return; 86 return;
81 } 87 }
82 if (doubleOrNullMemberValue.IsEmpty() || doubleOrNullMemberValue->IsUndefine d()) { 88 if (doubleOrNullMemberValue.IsEmpty() || doubleOrNullMemberValue->IsUndefine d()) {
83 // Do nothing. 89 // Do nothing.
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 } 629 }
624 630
625 TestDictionary NativeValueTraits<TestDictionary>::nativeValue(v8::Isolate* isola te, v8::Local<v8::Value> value, ExceptionState& exceptionState) 631 TestDictionary NativeValueTraits<TestDictionary>::nativeValue(v8::Isolate* isola te, v8::Local<v8::Value> value, ExceptionState& exceptionState)
626 { 632 {
627 TestDictionary impl; 633 TestDictionary impl;
628 V8TestDictionary::toImpl(isolate, value, impl, exceptionState); 634 V8TestDictionary::toImpl(isolate, value, impl, exceptionState);
629 return impl; 635 return impl;
630 } 636 }
631 637
632 } // namespace blink 638 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_types.py ('k') | Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698