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

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

Issue 229373006: Support optional, non-defaulted constructor arguments. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code adjustments Created 6 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 "V8TestInterfaceConstructor2.h" 8 #include "V8TestInterfaceConstructor2.h"
9 9
10 #include "RuntimeEnabledFeatures.h" 10 #include "RuntimeEnabledFeatures.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 v8SetReturnValue(info, wrapper); 56 v8SetReturnValue(info, wrapper);
57 } 57 }
58 58
59 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) 59 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info)
60 { 60 {
61 v8::Isolate* isolate = info.GetIsolate(); 61 v8::Isolate* isolate = info.GetIsolate();
62 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), isolate); 62 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), isolate);
63 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE mpty::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 63 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE mpty::toNativeWithTypeCheck(info.GetIsolate(), info[0]));
64 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[1], exceptionState), ex ceptionState); 64 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[1], exceptionState), ex ceptionState);
65 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, defaultUndefinedOpt ionalStringArg, info[2]); 65 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, defaultUndefinedOpt ionalStringArg, info[2]);
66 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, defaultNullStringOp tionalStringArg, argumentOrNull(info, 3)); 66 V8TRYCATCH_VOID(Dictionary, defaultUndefinedOptionalDictionaryArg, Dictionar y(info[3], info.GetIsolate()));
67 V8TRYCATCH_VOID(Dictionary, defaultUndefinedOptionalDictionaryArg, Dictionar y(info[4], info.GetIsolate()));
68 if (!defaultUndefinedOptionalDictionaryArg.isUndefinedOrNull() && !defaultUn definedOptionalDictionaryArg.isObject()) { 67 if (!defaultUndefinedOptionalDictionaryArg.isUndefinedOrNull() && !defaultUn definedOptionalDictionaryArg.isObject()) {
69 exceptionState.throwTypeError("parameter 5 ('defaultUndefinedOptionalDic tionaryArg') is not an object."); 68 exceptionState.throwTypeError("parameter 4 ('defaultUndefinedOptionalDic tionaryArg') is not an object.");
70 exceptionState.throwIfNeeded(); 69 exceptionState.throwIfNeeded();
71 return; 70 return;
72 } 71 }
73 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(t estInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaultNullStr ingOptionalStringArg, defaultUndefinedOptionalDictionaryArg); 72 if (UNLIKELY(info.Length() <= 4)) {
73 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::crea te(testInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaultUnd efinedOptionalDictionaryArg);
74 v8::Handle<v8::Object> wrapper = info.Holder();
75 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2>(im pl.release(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, isolate, W rapperConfiguration::Independent);
76 v8SetReturnValue(info, wrapper);
77 return;
78 }
79 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, optionalStringArg, info[4]);
80 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(t estInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaultUndefin edOptionalDictionaryArg, optionalStringArg);
74 81
75 v8::Handle<v8::Object> wrapper = info.Holder(); 82 v8::Handle<v8::Object> wrapper = info.Holder();
76 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2>(impl.r elease(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, isolate, Wrapp erConfiguration::Independent); 83 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor2>(impl.r elease(), &V8TestInterfaceConstructor2::wrapperTypeInfo, wrapper, isolate, Wrapp erConfiguration::Independent);
77 v8SetReturnValue(info, wrapper); 84 v8SetReturnValue(info, wrapper);
78 } 85 }
79 86
80 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) 87 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
81 { 88 {
82 if (((info.Length() == 1))) { 89 if (((info.Length() == 1))) {
83 TestInterfaceConstructor2V8Internal::constructor1(info); 90 TestInterfaceConstructor2V8Internal::constructor1(info);
84 return; 91 return;
85 } 92 }
86 if (((info.Length() == 2) && (V8TestInterfaceEmpty::hasInstance(info[0], inf o.GetIsolate()))) || ((info.Length() == 3) && (V8TestInterfaceEmpty::hasInstance (info[0], info.GetIsolate()))) || ((info.Length() == 4) && (V8TestInterfaceEmpty ::hasInstance(info[0], info.GetIsolate()))) || ((info.Length() == 5) && (V8TestI nterfaceEmpty::hasInstance(info[0], info.GetIsolate())) && (info[4]->IsUndefined () || info[4]->IsObject()))) { 93 if (((info.Length() == 2) && (V8TestInterfaceEmpty::hasInstance(info[0], inf o.GetIsolate()))) || ((info.Length() == 3) && (V8TestInterfaceEmpty::hasInstance (info[0], info.GetIsolate()))) || ((info.Length() == 4) && (V8TestInterfaceEmpty ::hasInstance(info[0], info.GetIsolate())) && (info[3]->IsUndefined() || info[3] ->IsObject())) || ((info.Length() == 5) && (V8TestInterfaceEmpty::hasInstance(in fo[0], info.GetIsolate())) && (info[3]->IsUndefined() || info[3]->IsObject()))) {
87 TestInterfaceConstructor2V8Internal::constructor2(info); 94 TestInterfaceConstructor2V8Internal::constructor2(info);
88 return; 95 return;
89 } 96 }
90 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate()); 97 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate());
91 if (UNLIKELY(info.Length() < 1)) { 98 if (UNLIKELY(info.Length() < 1)) {
92 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length())); 99 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length()));
93 exceptionState.throwIfNeeded(); 100 exceptionState.throwIfNeeded();
94 return; 101 return;
95 } 102 }
96 exceptionState.throwTypeError("No matching constructor signature."); 103 exceptionState.throwTypeError("No matching constructor signature.");
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 fromInternalPointer(object)->deref(); 195 fromInternalPointer(object)->deref();
189 } 196 }
190 197
191 template<> 198 template<>
192 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor2* impl, v8::Handle<v 8::Object> creationContext, v8::Isolate* isolate) 199 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor2* impl, v8::Handle<v 8::Object> creationContext, v8::Isolate* isolate)
193 { 200 {
194 return toV8(impl, creationContext, isolate); 201 return toV8(impl, creationContext, isolate);
195 } 202 }
196 203
197 } // namespace WebCore 204 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698