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

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

Issue 284163002: Better arity checks for overloads (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Return properly Created 6 years, 7 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 | Annotate | Revision Log
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 "V8TestTypedefs.h" 8 #include "V8TestTypedefs.h"
9 9
10 #include "RuntimeEnabledFeatures.h" 10 #include "RuntimeEnabledFeatures.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 static void voidMethodArrayOfLongsArgMethodCallback(const v8::FunctionCallbackIn fo<v8::Value>& info) 113 static void voidMethodArrayOfLongsArgMethodCallback(const v8::FunctionCallbackIn fo<v8::Value>& info)
114 { 114 {
115 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 115 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
116 TestTypedefsV8Internal::voidMethodArrayOfLongsArgMethod(info); 116 TestTypedefsV8Internal::voidMethodArrayOfLongsArgMethod(info);
117 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 117 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
118 } 118 }
119 119
120 static void voidMethodFloatArgStringArgMethod(const v8::FunctionCallbackInfo<v8: :Value>& info) 120 static void voidMethodFloatArgStringArgMethod(const v8::FunctionCallbackInfo<v8: :Value>& info)
121 { 121 {
122 if (UNLIKELY(info.Length() < 2)) { 122 if (UNLIKELY(info.Length() < 2)) {
123 throwArityTypeErrorForMethod("voidMethodFloatArgStringArg", "TestTypedef s", 2, info.Length(), info.GetIsolate()); 123 throwMinimumArityTypeErrorForMethod("voidMethodFloatArgStringArg", "Test Typedefs", 2, info.Length(), info.GetIsolate());
124 return; 124 return;
125 } 125 }
126 TestTypedefs* impl = V8TestTypedefs::toNative(info.Holder()); 126 TestTypedefs* impl = V8TestTypedefs::toNative(info.Holder());
127 TONATIVE_VOID(float, floatArg, static_cast<float>(info[0]->NumberValue())); 127 TONATIVE_VOID(float, floatArg, static_cast<float>(info[0]->NumberValue()));
128 TOSTRING_VOID(V8StringResource<>, stringArg, info[1]); 128 TOSTRING_VOID(V8StringResource<>, stringArg, info[1]);
129 impl->voidMethodFloatArgStringArg(floatArg, stringArg); 129 impl->voidMethodFloatArgStringArg(floatArg, stringArg);
130 } 130 }
131 131
132 static void voidMethodFloatArgStringArgMethodCallback(const v8::FunctionCallback Info<v8::Value>& info) 132 static void voidMethodFloatArgStringArgMethodCallback(const v8::FunctionCallback Info<v8::Value>& info)
133 { 133 {
134 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 134 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
135 TestTypedefsV8Internal::voidMethodFloatArgStringArgMethod(info); 135 TestTypedefsV8Internal::voidMethodFloatArgStringArgMethod(info);
136 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 136 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
137 } 137 }
138 138
139 static void voidMethodTestCallbackInterfaceTypeArgMethod(const v8::FunctionCallb ackInfo<v8::Value>& info) 139 static void voidMethodTestCallbackInterfaceTypeArgMethod(const v8::FunctionCallb ackInfo<v8::Value>& info)
140 { 140 {
141 if (UNLIKELY(info.Length() < 1)) { 141 if (UNLIKELY(info.Length() < 1)) {
142 throwArityTypeErrorForMethod("voidMethodTestCallbackInterfaceTypeArg", " TestTypedefs", 1, info.Length(), info.GetIsolate()); 142 throwMinimumArityTypeErrorForMethod("voidMethodTestCallbackInterfaceType Arg", "TestTypedefs", 1, info.Length(), info.GetIsolate());
143 return; 143 return;
144 } 144 }
145 TestTypedefs* impl = V8TestTypedefs::toNative(info.Holder()); 145 TestTypedefs* impl = V8TestTypedefs::toNative(info.Holder());
146 if (info.Length() <= 0 || !info[0]->IsFunction()) { 146 if (info.Length() <= 0 || !info[0]->IsFunction()) {
147 throwTypeError(ExceptionMessages::failedToExecute("voidMethodTestCallbac kInterfaceTypeArg", "TestTypedefs", "The callback provided as parameter 1 is not a function."), info.GetIsolate()); 147 throwTypeError(ExceptionMessages::failedToExecute("voidMethodTestCallbac kInterfaceTypeArg", "TestTypedefs", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
148 return; 148 return;
149 } 149 }
150 OwnPtr<TestCallbackInterface> testCallbackInterfaceTypeArg = V8TestCallbackI nterface::create(v8::Handle<v8::Function>::Cast(info[0]), currentExecutionContex t(info.GetIsolate())); 150 OwnPtr<TestCallbackInterface> testCallbackInterfaceTypeArg = V8TestCallbackI nterface::create(v8::Handle<v8::Function>::Cast(info[0]), currentExecutionContex t(info.GetIsolate()));
151 impl->voidMethodTestCallbackInterfaceTypeArg(testCallbackInterfaceTypeArg.re lease()); 151 impl->voidMethodTestCallbackInterfaceTypeArg(testCallbackInterfaceTypeArg.re lease());
152 } 152 }
153 153
154 static void voidMethodTestCallbackInterfaceTypeArgMethodCallback(const v8::Funct ionCallbackInfo<v8::Value>& info) 154 static void voidMethodTestCallbackInterfaceTypeArgMethodCallback(const v8::Funct ionCallbackInfo<v8::Value>& info)
155 { 155 {
156 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 156 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
157 TestTypedefsV8Internal::voidMethodTestCallbackInterfaceTypeArgMethod(info); 157 TestTypedefsV8Internal::voidMethodTestCallbackInterfaceTypeArgMethod(info);
158 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 158 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
159 } 159 }
160 160
161 static void uLongLongMethodTestInterfaceEmptyTypeSequenceArgMethod(const v8::Fun ctionCallbackInfo<v8::Value>& info) 161 static void uLongLongMethodTestInterfaceEmptyTypeSequenceArgMethod(const v8::Fun ctionCallbackInfo<v8::Value>& info)
162 { 162 {
163 if (UNLIKELY(info.Length() < 1)) { 163 if (UNLIKELY(info.Length() < 1)) {
164 throwArityTypeErrorForMethod("uLongLongMethodTestInterfaceEmptyTypeSeque nceArg", "TestTypedefs", 1, info.Length(), info.GetIsolate()); 164 throwMinimumArityTypeErrorForMethod("uLongLongMethodTestInterfaceEmptyTy peSequenceArg", "TestTypedefs", 1, info.Length(), info.GetIsolate());
165 return; 165 return;
166 } 166 }
167 TestTypedefs* impl = V8TestTypedefs::toNative(info.Holder()); 167 TestTypedefs* impl = V8TestTypedefs::toNative(info.Holder());
168 TONATIVE_VOID(Vector<RefPtr<TestInterfaceEmpty> >, testInterfaceEmptyTypeSeq uenceArg, (toRefPtrNativeArray<TestInterfaceEmpty, V8TestInterfaceEmpty>(info[0] , 1, info.GetIsolate()))); 168 TONATIVE_VOID(Vector<RefPtr<TestInterfaceEmpty> >, testInterfaceEmptyTypeSeq uenceArg, (toRefPtrNativeArray<TestInterfaceEmpty, V8TestInterfaceEmpty>(info[0] , 1, info.GetIsolate())));
169 v8SetReturnValue(info, static_cast<double>(impl->uLongLongMethodTestInterfac eEmptyTypeSequenceArg(testInterfaceEmptyTypeSequenceArg))); 169 v8SetReturnValue(info, static_cast<double>(impl->uLongLongMethodTestInterfac eEmptyTypeSequenceArg(testInterfaceEmptyTypeSequenceArg)));
170 } 170 }
171 171
172 static void uLongLongMethodTestInterfaceEmptyTypeSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 172 static void uLongLongMethodTestInterfaceEmptyTypeSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
173 { 173 {
174 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 174 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
(...skipping 23 matching lines...) Expand all
198 static void fooOrBarMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Valu e>& info) 198 static void fooOrBarMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Valu e>& info)
199 { 199 {
200 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 200 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
201 TestTypedefsV8Internal::fooOrBarMethodMethod(info); 201 TestTypedefsV8Internal::fooOrBarMethodMethod(info);
202 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 202 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
203 } 203 }
204 204
205 static void arrayOfStringsMethodArrayOfStringsArgMethod(const v8::FunctionCallba ckInfo<v8::Value>& info) 205 static void arrayOfStringsMethodArrayOfStringsArgMethod(const v8::FunctionCallba ckInfo<v8::Value>& info)
206 { 206 {
207 if (UNLIKELY(info.Length() < 1)) { 207 if (UNLIKELY(info.Length() < 1)) {
208 throwArityTypeErrorForMethod("arrayOfStringsMethodArrayOfStringsArg", "T estTypedefs", 1, info.Length(), info.GetIsolate()); 208 throwMinimumArityTypeErrorForMethod("arrayOfStringsMethodArrayOfStringsA rg", "TestTypedefs", 1, info.Length(), info.GetIsolate());
209 return; 209 return;
210 } 210 }
211 TestTypedefs* impl = V8TestTypedefs::toNative(info.Holder()); 211 TestTypedefs* impl = V8TestTypedefs::toNative(info.Holder());
212 TONATIVE_VOID(Vector<String>, arrayOfStringsArg, toNativeArray<String>(info[ 0], 1, info.GetIsolate())); 212 TONATIVE_VOID(Vector<String>, arrayOfStringsArg, toNativeArray<String>(info[ 0], 1, info.GetIsolate()));
213 v8SetReturnValue(info, v8Array(impl->arrayOfStringsMethodArrayOfStringsArg(a rrayOfStringsArg), info.GetIsolate())); 213 v8SetReturnValue(info, v8Array(impl->arrayOfStringsMethodArrayOfStringsArg(a rrayOfStringsArg), info.GetIsolate()));
214 } 214 }
215 215
216 static void arrayOfStringsMethodArrayOfStringsArgMethodCallback(const v8::Functi onCallbackInfo<v8::Value>& info) 216 static void arrayOfStringsMethodArrayOfStringsArgMethodCallback(const v8::Functi onCallbackInfo<v8::Value>& info)
217 { 217 {
218 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 218 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
219 TestTypedefsV8Internal::arrayOfStringsMethodArrayOfStringsArgMethod(info); 219 TestTypedefsV8Internal::arrayOfStringsMethodArrayOfStringsArgMethod(info);
220 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 220 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
221 } 221 }
222 222
223 static void stringArrayMethodStringArrayArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info) 223 static void stringArrayMethodStringArrayArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info)
224 { 224 {
225 if (UNLIKELY(info.Length() < 1)) { 225 if (UNLIKELY(info.Length() < 1)) {
226 throwArityTypeErrorForMethod("stringArrayMethodStringArrayArg", "TestTyp edefs", 1, info.Length(), info.GetIsolate()); 226 throwMinimumArityTypeErrorForMethod("stringArrayMethodStringArrayArg", " TestTypedefs", 1, info.Length(), info.GetIsolate());
227 return; 227 return;
228 } 228 }
229 TestTypedefs* impl = V8TestTypedefs::toNative(info.Holder()); 229 TestTypedefs* impl = V8TestTypedefs::toNative(info.Holder());
230 TONATIVE_VOID(Vector<String>, stringArrayArg, toNativeArray<String>(info[0], 1, info.GetIsolate())); 230 TONATIVE_VOID(Vector<String>, stringArrayArg, toNativeArray<String>(info[0], 1, info.GetIsolate()));
231 v8SetReturnValue(info, v8Array(impl->stringArrayMethodStringArrayArg(stringA rrayArg), info.GetIsolate())); 231 v8SetReturnValue(info, v8Array(impl->stringArrayMethodStringArrayArg(stringA rrayArg), info.GetIsolate()));
232 } 232 }
233 233
234 static void stringArrayMethodStringArrayArgMethodCallback(const v8::FunctionCall backInfo<v8::Value>& info) 234 static void stringArrayMethodStringArrayArgMethodCallback(const v8::FunctionCall backInfo<v8::Value>& info)
235 { 235 {
236 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 236 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
237 TestTypedefsV8Internal::stringArrayMethodStringArrayArgMethod(info); 237 TestTypedefsV8Internal::stringArrayMethodStringArrayArgMethod(info);
238 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 238 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
239 } 239 }
240 240
241 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) 241 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
242 { 242 {
243 v8::Isolate* isolate = info.GetIsolate(); 243 v8::Isolate* isolate = info.GetIsolate();
244 if (UNLIKELY(info.Length() < 1)) { 244 if (UNLIKELY(info.Length() < 1)) {
245 throwArityTypeErrorForConstructor("TestTypedefs", 1, info.Length(), info .GetIsolate()); 245 throwMinimumArityTypeErrorForConstructor("TestTypedefs", 1, info.Length( ), info.GetIsolate());
246 return; 246 return;
247 } 247 }
248 TOSTRING_VOID(V8StringResource<>, stringArg, info[0]); 248 TOSTRING_VOID(V8StringResource<>, stringArg, info[0]);
249 RefPtr<TestTypedefs> impl = TestTypedefs::create(stringArg); 249 RefPtr<TestTypedefs> impl = TestTypedefs::create(stringArg);
250 250
251 v8::Handle<v8::Object> wrapper = info.Holder(); 251 v8::Handle<v8::Object> wrapper = info.Holder();
252 V8DOMWrapper::associateObjectWithWrapper<V8TestTypedefs>(impl.release(), &V8 TestTypedefs::wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independe nt); 252 V8DOMWrapper::associateObjectWithWrapper<V8TestTypedefs>(impl.release(), &V8 TestTypedefs::wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independe nt);
253 v8SetReturnValue(info, wrapper); 253 v8SetReturnValue(info, wrapper);
254 } 254 }
255 255
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 fromInternalPointer(object)->deref(); 359 fromInternalPointer(object)->deref();
360 } 360 }
361 361
362 template<> 362 template<>
363 v8::Handle<v8::Value> toV8NoInline(TestTypedefs* impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate) 363 v8::Handle<v8::Value> toV8NoInline(TestTypedefs* impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate)
364 { 364 {
365 return toV8(impl, creationContext, isolate); 365 return toV8(impl, creationContext, isolate);
366 } 366 }
367 367
368 } // namespace WebCore 368 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestSpecialOperations.cpp ('k') | Source/bindings/v8/ExceptionMessages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698