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

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

Issue 24203002: Improve generated "Not enough arguments." TypeError exceptions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: NeedsRebaseline Created 7 years, 3 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 /* 1 /*
2 This file is part of the Blink open source project. 2 This file is part of the Blink open source project.
3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY!
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19 */ 19 */
20 20
21 #include "config.h" 21 #include "config.h"
22 #include "V8TestTypedefs.h" 22 #include "V8TestTypedefs.h"
23 23
24 #include "RuntimeEnabledFeatures.h" 24 #include "RuntimeEnabledFeatures.h"
25 #include "V8SVGPoint.h" 25 #include "V8SVGPoint.h"
26 #include "V8SerializedScriptValue.h" 26 #include "V8SerializedScriptValue.h"
27 #include "V8TestCallback.h" 27 #include "V8TestCallback.h"
28 #include "V8TestSubObj.h" 28 #include "V8TestSubObj.h"
29 #include "bindings/v8/ExceptionMessages.h"
29 #include "bindings/v8/ExceptionState.h" 30 #include "bindings/v8/ExceptionState.h"
30 #include "bindings/v8/ScriptController.h" 31 #include "bindings/v8/ScriptController.h"
31 #include "bindings/v8/SerializedScriptValue.h" 32 #include "bindings/v8/SerializedScriptValue.h"
32 #include "bindings/v8/V8Binding.h" 33 #include "bindings/v8/V8Binding.h"
33 #include "bindings/v8/V8DOMConfiguration.h" 34 #include "bindings/v8/V8DOMConfiguration.h"
34 #include "bindings/v8/V8DOMWrapper.h" 35 #include "bindings/v8/V8DOMWrapper.h"
35 #include "bindings/v8/V8ObjectConstructor.h" 36 #include "bindings/v8/V8ObjectConstructor.h"
36 #include "core/dom/ContextFeatures.h" 37 #include "core/dom/ContextFeatures.h"
37 #include "core/dom/Document.h" 38 #include "core/dom/Document.h"
38 #include "core/platform/chromium/TraceEvent.h" 39 #include "core/platform/chromium/TraceEvent.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 static void funcMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args) 290 static void funcMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args)
290 { 291 {
291 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 292 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
292 TestTypedefsV8Internal::funcMethod(args); 293 TestTypedefsV8Internal::funcMethod(args);
293 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 294 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
294 } 295 }
295 296
296 static void setShadowMethod(const v8::FunctionCallbackInfo<v8::Value>& args) 297 static void setShadowMethod(const v8::FunctionCallbackInfo<v8::Value>& args)
297 { 298 {
298 if (UNLIKELY(args.Length() < 3)) { 299 if (UNLIKELY(args.Length() < 3)) {
299 throwNotEnoughArgumentsError(args.GetIsolate()); 300 throwTypeError(ExceptionMessages::failedToExecute("setShadow", "TestType defs", ExceptionMessages::notEnoughArguments(3, args.Length())), args.GetIsolate ());
300 return; 301 return;
301 } 302 }
302 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); 303 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder());
303 V8TRYCATCH_VOID(float, width, static_cast<float>(args[0]->NumberValue())); 304 V8TRYCATCH_VOID(float, width, static_cast<float>(args[0]->NumberValue()));
304 V8TRYCATCH_VOID(float, height, static_cast<float>(args[1]->NumberValue())); 305 V8TRYCATCH_VOID(float, height, static_cast<float>(args[1]->NumberValue()));
305 V8TRYCATCH_VOID(float, blur, static_cast<float>(args[2]->NumberValue())); 306 V8TRYCATCH_VOID(float, blur, static_cast<float>(args[2]->NumberValue()));
306 if (UNLIKELY(args.Length() <= 3)) { 307 if (UNLIKELY(args.Length() <= 3)) {
307 imp->setShadow(width, height, blur); 308 imp->setShadow(width, height, blur);
308 309
309 return; 310 return;
(...skipping 13 matching lines...) Expand all
323 static void setShadowMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& a rgs) 324 static void setShadowMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& a rgs)
324 { 325 {
325 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 326 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
326 TestTypedefsV8Internal::setShadowMethod(args); 327 TestTypedefsV8Internal::setShadowMethod(args);
327 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 328 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
328 } 329 }
329 330
330 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value >& args) 331 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value >& args)
331 { 332 {
332 if (UNLIKELY(args.Length() < 1)) { 333 if (UNLIKELY(args.Length() < 1)) {
333 throwNotEnoughArgumentsError(args.GetIsolate()); 334 throwTypeError(ExceptionMessages::failedToExecute("methodWithSequenceArg ", "TestTypedefs", ExceptionMessages::notEnoughArguments(1, args.Length())), arg s.GetIsolate());
334 return; 335 return;
335 } 336 }
336 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); 337 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder());
337 V8TRYCATCH_VOID(Vector<RefPtr<SerializedScriptValue> >, sequenceArg, (toRefP trNativeArray<SerializedScriptValue, V8SerializedScriptValue>(args[0], args.GetI solate()))); 338 V8TRYCATCH_VOID(Vector<RefPtr<SerializedScriptValue> >, sequenceArg, (toRefP trNativeArray<SerializedScriptValue, V8SerializedScriptValue>(args[0], args.GetI solate())));
338 v8SetReturnValue(args, static_cast<double>(imp->methodWithSequenceArg(sequen ceArg))); 339 v8SetReturnValue(args, static_cast<double>(imp->methodWithSequenceArg(sequen ceArg)));
339 return; 340 return;
340 } 341 }
341 342
342 static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& args) 343 static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& args)
343 { 344 {
344 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 345 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
345 TestTypedefsV8Internal::methodWithSequenceArgMethod(args); 346 TestTypedefsV8Internal::methodWithSequenceArgMethod(args);
346 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 347 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
347 } 348 }
348 349
349 static void nullableArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& ar gs) 350 static void nullableArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& ar gs)
350 { 351 {
351 if (UNLIKELY(args.Length() < 1)) { 352 if (UNLIKELY(args.Length() < 1)) {
352 throwNotEnoughArgumentsError(args.GetIsolate()); 353 throwTypeError(ExceptionMessages::failedToExecute("nullableArrayArg", "T estTypedefs", ExceptionMessages::notEnoughArguments(1, args.Length())), args.Get Isolate());
353 return; 354 return;
354 } 355 }
355 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); 356 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder());
356 V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(args[0], arg s.GetIsolate())); 357 V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(args[0], arg s.GetIsolate()));
357 imp->nullableArrayArg(arrayArg); 358 imp->nullableArrayArg(arrayArg);
358 359
359 return; 360 return;
360 } 361 }
361 362
362 static void nullableArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Va lue>& args) 363 static void nullableArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Va lue>& args)
363 { 364 {
364 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 365 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
365 TestTypedefsV8Internal::nullableArrayArgMethod(args); 366 TestTypedefsV8Internal::nullableArrayArgMethod(args);
366 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 367 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
367 } 368 }
368 369
369 static void funcWithClampMethod(const v8::FunctionCallbackInfo<v8::Value>& args) 370 static void funcWithClampMethod(const v8::FunctionCallbackInfo<v8::Value>& args)
370 { 371 {
371 if (UNLIKELY(args.Length() < 1)) { 372 if (UNLIKELY(args.Length() < 1)) {
372 throwNotEnoughArgumentsError(args.GetIsolate()); 373 throwTypeError(ExceptionMessages::failedToExecute("funcWithClamp", "Test Typedefs", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIso late());
373 return; 374 return;
374 } 375 }
375 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); 376 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder());
376 unsigned long long arg1 = 0; 377 unsigned long long arg1 = 0;
377 V8TRYCATCH_VOID(double, arg1NativeValue, args[0]->NumberValue()); 378 V8TRYCATCH_VOID(double, arg1NativeValue, args[0]->NumberValue());
378 if (!std::isnan(arg1NativeValue)) 379 if (!std::isnan(arg1NativeValue))
379 arg1 = clampTo<unsigned long long>(arg1NativeValue); 380 arg1 = clampTo<unsigned long long>(arg1NativeValue);
380 if (UNLIKELY(args.Length() <= 1)) { 381 if (UNLIKELY(args.Length() <= 1)) {
381 imp->funcWithClamp(arg1); 382 imp->funcWithClamp(arg1);
382 383
(...skipping 25 matching lines...) Expand all
408 static void immutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo< v8::Value>& args) 409 static void immutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo< v8::Value>& args)
409 { 410 {
410 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 411 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
411 TestTypedefsV8Internal::immutablePointFunctionMethod(args); 412 TestTypedefsV8Internal::immutablePointFunctionMethod(args);
412 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 413 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
413 } 414 }
414 415
415 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& args) 416 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& args)
416 { 417 {
417 if (UNLIKELY(args.Length() < 1)) { 418 if (UNLIKELY(args.Length() < 1)) {
418 throwNotEnoughArgumentsError(args.GetIsolate()); 419 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction", "TestTypedefs", ExceptionMessages::notEnoughArguments(1, args.Length())), args. GetIsolate());
419 return; 420 return;
420 } 421 }
421 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); 422 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder());
422 ExceptionState es(args.GetIsolate()); 423 ExceptionState es(args.GetIsolate());
423 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(args[0], args. GetIsolate())); 424 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(args[0], args. GetIsolate()));
424 Vector<String> result = imp->stringArrayFunction(values, es); 425 Vector<String> result = imp->stringArrayFunction(values, es);
425 if (es.throwIfNeeded()) 426 if (es.throwIfNeeded())
426 return; 427 return;
427 v8SetReturnValue(args, v8Array(result, args.GetIsolate())); 428 v8SetReturnValue(args, v8Array(result, args.GetIsolate()));
428 return; 429 return;
429 } 430 }
430 431
431 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& args) 432 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& args)
432 { 433 {
433 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 434 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
434 TestTypedefsV8Internal::stringArrayFunctionMethod(args); 435 TestTypedefsV8Internal::stringArrayFunctionMethod(args);
435 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 436 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
436 } 437 }
437 438
438 static void stringArrayFunction2Method(const v8::FunctionCallbackInfo<v8::Value> & args) 439 static void stringArrayFunction2Method(const v8::FunctionCallbackInfo<v8::Value> & args)
439 { 440 {
440 if (UNLIKELY(args.Length() < 1)) { 441 if (UNLIKELY(args.Length() < 1)) {
441 throwNotEnoughArgumentsError(args.GetIsolate()); 442 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction2" , "TestTypedefs", ExceptionMessages::notEnoughArguments(1, args.Length())), args .GetIsolate());
442 return; 443 return;
443 } 444 }
444 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); 445 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder());
445 ExceptionState es(args.GetIsolate()); 446 ExceptionState es(args.GetIsolate());
446 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(args[0], args. GetIsolate())); 447 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(args[0], args. GetIsolate()));
447 Vector<String> result = imp->stringArrayFunction2(values, es); 448 Vector<String> result = imp->stringArrayFunction2(values, es);
448 if (es.throwIfNeeded()) 449 if (es.throwIfNeeded())
449 return; 450 return;
450 v8SetReturnValue(args, v8Array(result, args.GetIsolate())); 451 v8SetReturnValue(args, v8Array(result, args.GetIsolate()));
451 return; 452 return;
(...skipping 20 matching lines...) Expand all
472 static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& args) 473 static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& args)
473 { 474 {
474 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 475 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
475 TestTypedefsV8Internal::methodWithExceptionMethod(args); 476 TestTypedefsV8Internal::methodWithExceptionMethod(args);
476 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 477 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
477 } 478 }
478 479
479 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& args) 480 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& args)
480 { 481 {
481 if (UNLIKELY(args.Length() < 2)) { 482 if (UNLIKELY(args.Length() < 2)) {
482 throwNotEnoughArgumentsError(args.GetIsolate()); 483 throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestTy pedefs", ExceptionMessages::notEnoughArguments(2, args.Length())), args.GetIsola te());
483 return; 484 return;
484 } 485 }
485 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, hello, args[0]); 486 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, hello, args[0]);
486 if (args.Length() <= 1 || !args[1]->IsFunction()) { 487 if (args.Length() <= 1 || !args[1]->IsFunction()) {
487 throwTypeError(args.GetIsolate()); 488 throwTypeError(args.GetIsolate());
488 return; 489 return;
489 } 490 }
490 RefPtr<TestCallback> testCallback = V8TestCallback::create(args[1], getScrip tExecutionContext()); 491 RefPtr<TestCallback> testCallback = V8TestCallback::create(args[1], getScrip tExecutionContext());
491 492
492 RefPtr<TestTypedefs> impl = TestTypedefs::create(hello, testCallback); 493 RefPtr<TestTypedefs> impl = TestTypedefs::create(hello, testCallback);
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 V8DOMWrapper::associateObjectWithWrapper<V8TestTypedefs>(impl, &info, wrappe r, isolate, WrapperConfiguration::Independent); 604 V8DOMWrapper::associateObjectWithWrapper<V8TestTypedefs>(impl, &info, wrappe r, isolate, WrapperConfiguration::Independent);
604 return wrapper; 605 return wrapper;
605 } 606 }
606 607
607 void V8TestTypedefs::derefObject(void* object) 608 void V8TestTypedefs::derefObject(void* object)
608 { 609 {
609 fromInternalPointer(object)->deref(); 610 fromInternalPointer(object)->deref();
610 } 611 }
611 612
612 } // namespace WebCore 613 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestOverloadedConstructors.cpp ('k') | Source/bindings/v8/ExceptionMessages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698