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

Side by Side Diff: Source/bindings/tests/results/V8TestInterfaceConstructor2.cpp

Issue 337343002: IDL: make optional arguments (without default) explicit sometimes Base URL: https://chromium.googlesource.com/chromium/blink.git@idl-default-arguments-next
Patch Set: Created 6 years, 4 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 "V8TestInterfaceConstructor2.h" 8 #include "V8TestInterfaceConstructor2.h"
9 9
10 #include "bindings/core/v8/Dictionary.h" 10 #include "bindings/core/v8/Dictionary.h"
11 #include "bindings/core/v8/ExceptionState.h" 11 #include "bindings/core/v8/ExceptionState.h"
12 #include "bindings/core/v8/Optional.h"
12 #include "bindings/core/v8/V8DOMConfiguration.h" 13 #include "bindings/core/v8/V8DOMConfiguration.h"
13 #include "bindings/core/v8/V8HiddenValue.h" 14 #include "bindings/core/v8/V8HiddenValue.h"
14 #include "bindings/core/v8/V8ObjectConstructor.h" 15 #include "bindings/core/v8/V8ObjectConstructor.h"
15 #include "bindings/tests/v8/V8TestInterfaceEmpty.h" 16 #include "bindings/tests/v8/V8TestInterfaceEmpty.h"
16 #include "core/dom/ContextFeatures.h" 17 #include "core/dom/ContextFeatures.h"
17 #include "core/dom/Document.h" 18 #include "core/dom/Document.h"
18 #include "core/frame/LocalDOMWindow.h" 19 #include "core/frame/LocalDOMWindow.h"
19 #include "platform/RuntimeEnabledFeatures.h" 20 #include "platform/RuntimeEnabledFeatures.h"
20 #include "platform/TraceEvent.h" 21 #include "platform/TraceEvent.h"
21 #include "wtf/GetPtr.h" 22 #include "wtf/GetPtr.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2>(impl.r elease(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, info.GetIsolat e(), WrapperConfiguration::Independent); 75 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2>(impl.r elease(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, info.GetIsolat e(), WrapperConfiguration::Independent);
75 v8SetReturnValue(info, wrapper); 76 v8SetReturnValue(info, wrapper);
76 } 77 }
77 78
78 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info) 79 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info)
79 { 80 {
80 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate()); 81 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate());
81 TestInterfaceEmpty* testInterfaceEmptyArg; 82 TestInterfaceEmpty* testInterfaceEmptyArg;
82 int longArg; 83 int longArg;
83 V8StringResource<> defaultUndefinedOptionalStringArg; 84 V8StringResource<> defaultUndefinedOptionalStringArg;
85 bool defaultUndefinedOptionalStringArgMissing = false;
84 V8StringResource<> defaultNullStringOptionalStringArg; 86 V8StringResource<> defaultNullStringOptionalStringArg;
85 Dictionary defaultUndefinedOptionalDictionaryArg; 87 Dictionary defaultUndefinedOptionalDictionaryArg;
88 bool defaultUndefinedOptionalDictionaryArgMissing = false;
86 V8StringResource<> optionalStringArg; 89 V8StringResource<> optionalStringArg;
90 bool optionalStringArgMissing = false;
87 { 91 {
88 v8::TryCatch block; 92 v8::TryCatch block;
89 V8RethrowTryCatchScope rethrow(block); 93 V8RethrowTryCatchScope rethrow(block);
90 TONATIVE_VOID_INTERNAL(testInterfaceEmptyArg, V8TestInterfaceEmpty::toNa tiveWithTypeCheck(info.GetIsolate(), info[0])); 94 TONATIVE_VOID_INTERNAL(testInterfaceEmptyArg, V8TestInterfaceEmpty::toNa tiveWithTypeCheck(info.GetIsolate(), info[0]));
91 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[1], exceptio nState), exceptionState); 95 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(longArg, toInt32(info[1], exceptio nState), exceptionState);
92 TOSTRING_VOID_INTERNAL(defaultUndefinedOptionalStringArg, info[2]); 96 if (!info[2]->IsUndefined()) {
97 TOSTRING_VOID_INTERNAL(defaultUndefinedOptionalStringArg, info[2]);
98 } else {
99 defaultUndefinedOptionalStringArgMissing = true;
100 }
93 if (!info[3]->IsUndefined()) { 101 if (!info[3]->IsUndefined()) {
94 TOSTRING_VOID_INTERNAL(defaultNullStringOptionalStringArg, info[3]); 102 TOSTRING_VOID_INTERNAL(defaultNullStringOptionalStringArg, info[3]);
95 } else { 103 } else {
96 defaultNullStringOptionalStringArg = nullptr; 104 defaultNullStringOptionalStringArg = nullptr;
97 } 105 }
98 TONATIVE_VOID_INTERNAL(defaultUndefinedOptionalDictionaryArg, Dictionary (info[4], info.GetIsolate())); 106 if (!info[4]->IsUndefined()) {
99 if (!defaultUndefinedOptionalDictionaryArg.isUndefinedOrNull() && !defau ltUndefinedOptionalDictionaryArg.isObject()) { 107 TONATIVE_VOID_INTERNAL(defaultUndefinedOptionalDictionaryArg, Dictio nary(info[4], info.GetIsolate()));
100 exceptionState.throwTypeError("parameter 5 ('defaultUndefinedOptiona lDictionaryArg') is not an object."); 108 if (!defaultUndefinedOptionalDictionaryArg.isUndefinedOrNull() && !d efaultUndefinedOptionalDictionaryArg.isObject()) {
101 exceptionState.throwIfNeeded(); 109 exceptionState.throwTypeError("parameter 5 ('defaultUndefinedOpt ionalDictionaryArg') is not an object.");
102 return; 110 exceptionState.throwIfNeeded();
111 return;
112 }
113 } else {
114 defaultUndefinedOptionalDictionaryArgMissing = true;
103 } 115 }
104 if (UNLIKELY(info.Length() <= 5)) { 116 if (!info[5]->IsUndefined()) {
105 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2:: create(testInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaul tNullStringOptionalStringArg, defaultUndefinedOptionalDictionaryArg); 117 TOSTRING_VOID_INTERNAL(optionalStringArg, info[5]);
106 v8::Handle<v8::Object> wrapper = info.Holder(); 118 } else {
107 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2 >(impl.release(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, info.G etIsolate(), WrapperConfiguration::Independent); 119 optionalStringArgMissing = true;
108 v8SetReturnValue(info, wrapper);
109 return;
110 } 120 }
111 TOSTRING_VOID_INTERNAL(optionalStringArg, info[5]);
112 } 121 }
113 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(t estInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaultNullStr ingOptionalStringArg, defaultUndefinedOptionalDictionaryArg, optionalStringArg); 122 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(t estInterfaceEmptyArg, longArg, Optional<V8StringResource<> >(defaultUndefinedOpt ionalStringArg, defaultUndefinedOptionalStringArgMissing), defaultNullStringOpti onalStringArg, Optional<Dictionary>(defaultUndefinedOptionalDictionaryArg, defau ltUndefinedOptionalDictionaryArgMissing), Optional<V8StringResource<> >(optional StringArg, optionalStringArgMissing));
114 v8::Handle<v8::Object> wrapper = info.Holder(); 123 v8::Handle<v8::Object> wrapper = info.Holder();
115 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2>(impl.r elease(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, info.GetIsolat e(), WrapperConfiguration::Independent); 124 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2>(impl.r elease(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, info.GetIsolat e(), WrapperConfiguration::Independent);
116 v8SetReturnValue(info, wrapper); 125 v8SetReturnValue(info, wrapper);
117 } 126 }
118 127
119 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) 128 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
120 { 129 {
121 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate()); 130 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate());
122 switch (std::min(6, info.Length())) { 131 switch (std::min(6, info.Length())) {
123 case 1: 132 case 1:
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 fromInternalPointer(internalPointer)->deref(); 267 fromInternalPointer(internalPointer)->deref();
259 } 268 }
260 269
261 template<> 270 template<>
262 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor2* impl, v8::Handle<v 8::Object> creationContext, v8::Isolate* isolate) 271 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor2* impl, v8::Handle<v 8::Object> creationContext, v8::Isolate* isolate)
263 { 272 {
264 return toV8(impl, creationContext, isolate); 273 return toV8(impl, creationContext, isolate);
265 } 274 }
266 275
267 } // namespace blink 276 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698