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

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

Issue 38063003: Improve TypeError messages from failed array conversions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Improve TypeError messages from failed array conversions. Created 7 years, 1 month 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
« no previous file with comments | « Source/bindings/tests/results/V8TestObjectPython.cpp ('k') | Source/bindings/v8/Dictionary.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 } 262 }
263 263
264 static void funcMethod(const v8::FunctionCallbackInfo<v8::Value>& args) 264 static void funcMethod(const v8::FunctionCallbackInfo<v8::Value>& args)
265 { 265 {
266 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); 266 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder());
267 if (UNLIKELY(args.Length() <= 0)) { 267 if (UNLIKELY(args.Length() <= 0)) {
268 imp->func(); 268 imp->func();
269 269
270 return; 270 return;
271 } 271 }
272 V8TRYCATCH_VOID(Vector<int>, x, toNativeArray<int>(args[0], args.GetIsolate( ))); 272 V8TRYCATCH_VOID(Vector<int>, x, toNativeArray<int>(args[0], 1, args.GetIsola te()));
273 imp->func(x); 273 imp->func(x);
274 274
275 return; 275 return;
276 } 276 }
277 277
278 static void funcMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args) 278 static void funcMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args)
279 { 279 {
280 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 280 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
281 TestTypedefsV8Internal::funcMethod(args); 281 TestTypedefsV8Internal::funcMethod(args);
282 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 282 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 316 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
317 } 317 }
318 318
319 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value >& args) 319 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value >& args)
320 { 320 {
321 if (UNLIKELY(args.Length() < 1)) { 321 if (UNLIKELY(args.Length() < 1)) {
322 throwTypeError(ExceptionMessages::failedToExecute("methodWithSequenceArg ", "TestTypedefs", ExceptionMessages::notEnoughArguments(1, args.Length())), arg s.GetIsolate()); 322 throwTypeError(ExceptionMessages::failedToExecute("methodWithSequenceArg ", "TestTypedefs", ExceptionMessages::notEnoughArguments(1, args.Length())), arg s.GetIsolate());
323 return; 323 return;
324 } 324 }
325 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); 325 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder());
326 V8TRYCATCH_VOID(Vector<RefPtr<SerializedScriptValue> >, sequenceArg, (toRefP trNativeArray<SerializedScriptValue, V8SerializedScriptValue>(args[0], args.GetI solate()))); 326 V8TRYCATCH_VOID(Vector<RefPtr<SerializedScriptValue> >, sequenceArg, (toRefP trNativeArray<SerializedScriptValue, V8SerializedScriptValue>(args[0], 1, args.G etIsolate())));
327 v8SetReturnValue(args, static_cast<double>(imp->methodWithSequenceArg(sequen ceArg))); 327 v8SetReturnValue(args, static_cast<double>(imp->methodWithSequenceArg(sequen ceArg)));
328 return; 328 return;
329 } 329 }
330 330
331 static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& args) 331 static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& args)
332 { 332 {
333 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 333 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
334 TestTypedefsV8Internal::methodWithSequenceArgMethod(args); 334 TestTypedefsV8Internal::methodWithSequenceArgMethod(args);
335 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 335 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
336 } 336 }
337 337
338 static void nullableArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& ar gs) 338 static void nullableArrayArgMethod(const v8::FunctionCallbackInfo<v8::Value>& ar gs)
339 { 339 {
340 if (UNLIKELY(args.Length() < 1)) { 340 if (UNLIKELY(args.Length() < 1)) {
341 throwTypeError(ExceptionMessages::failedToExecute("nullableArrayArg", "T estTypedefs", ExceptionMessages::notEnoughArguments(1, args.Length())), args.Get Isolate()); 341 throwTypeError(ExceptionMessages::failedToExecute("nullableArrayArg", "T estTypedefs", ExceptionMessages::notEnoughArguments(1, args.Length())), args.Get Isolate());
342 return; 342 return;
343 } 343 }
344 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); 344 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder());
345 bool arrayArgIsNull = args[0]->IsNull(); 345 bool arrayArgIsNull = args[0]->IsNull();
346 V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(args[0], arg s.GetIsolate())); 346 V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(args[0], 1, args.GetIsolate()));
347 imp->nullableArrayArg(arrayArgIsNull ? 0 : &arrayArg); 347 imp->nullableArrayArg(arrayArgIsNull ? 0 : &arrayArg);
348 348
349 return; 349 return;
350 } 350 }
351 351
352 static void nullableArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Va lue>& args) 352 static void nullableArrayArgMethodCallback(const v8::FunctionCallbackInfo<v8::Va lue>& args)
353 { 353 {
354 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 354 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
355 TestTypedefsV8Internal::nullableArrayArgMethod(args); 355 TestTypedefsV8Internal::nullableArrayArgMethod(args);
356 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 356 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 } 403 }
404 404
405 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& args) 405 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& args)
406 { 406 {
407 if (UNLIKELY(args.Length() < 1)) { 407 if (UNLIKELY(args.Length() < 1)) {
408 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction", "TestTypedefs", ExceptionMessages::notEnoughArguments(1, args.Length())), args. GetIsolate()); 408 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction", "TestTypedefs", ExceptionMessages::notEnoughArguments(1, args.Length())), args. GetIsolate());
409 return; 409 return;
410 } 410 }
411 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); 411 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder());
412 ExceptionState es(args.GetIsolate()); 412 ExceptionState es(args.GetIsolate());
413 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(args[0], args. GetIsolate())); 413 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(args[0], 1, ar gs.GetIsolate()));
414 Vector<String> result = imp->stringArrayFunction(values, es); 414 Vector<String> result = imp->stringArrayFunction(values, es);
415 if (es.throwIfNeeded()) 415 if (es.throwIfNeeded())
416 return; 416 return;
417 v8SetReturnValue(args, v8Array(result, args.GetIsolate())); 417 v8SetReturnValue(args, v8Array(result, args.GetIsolate()));
418 return; 418 return;
419 } 419 }
420 420
421 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& args) 421 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& args)
422 { 422 {
423 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 423 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
424 TestTypedefsV8Internal::stringArrayFunctionMethod(args); 424 TestTypedefsV8Internal::stringArrayFunctionMethod(args);
425 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 425 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
426 } 426 }
427 427
428 static void stringArrayFunction2Method(const v8::FunctionCallbackInfo<v8::Value> & args) 428 static void stringArrayFunction2Method(const v8::FunctionCallbackInfo<v8::Value> & args)
429 { 429 {
430 if (UNLIKELY(args.Length() < 1)) { 430 if (UNLIKELY(args.Length() < 1)) {
431 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction2" , "TestTypedefs", ExceptionMessages::notEnoughArguments(1, args.Length())), args .GetIsolate()); 431 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction2" , "TestTypedefs", ExceptionMessages::notEnoughArguments(1, args.Length())), args .GetIsolate());
432 return; 432 return;
433 } 433 }
434 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder()); 434 TestTypedefs* imp = V8TestTypedefs::toNative(args.Holder());
435 ExceptionState es(args.GetIsolate()); 435 ExceptionState es(args.GetIsolate());
436 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(args[0], args. GetIsolate())); 436 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(args[0], 1, ar gs.GetIsolate()));
437 Vector<String> result = imp->stringArrayFunction2(values, es); 437 Vector<String> result = imp->stringArrayFunction2(values, es);
438 if (es.throwIfNeeded()) 438 if (es.throwIfNeeded())
439 return; 439 return;
440 v8SetReturnValue(args, v8Array(result, args.GetIsolate())); 440 v8SetReturnValue(args, v8Array(result, args.GetIsolate()));
441 return; 441 return;
442 } 442 }
443 443
444 static void stringArrayFunction2MethodCallback(const v8::FunctionCallbackInfo<v8 ::Value>& args) 444 static void stringArrayFunction2MethodCallback(const v8::FunctionCallbackInfo<v8 ::Value>& args)
445 { 445 {
446 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 446 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 V8DOMWrapper::associateObjectWithWrapper<V8TestTypedefs>(impl, &info, wrappe r, isolate, WrapperConfiguration::Independent); 593 V8DOMWrapper::associateObjectWithWrapper<V8TestTypedefs>(impl, &info, wrappe r, isolate, WrapperConfiguration::Independent);
594 return wrapper; 594 return wrapper;
595 } 595 }
596 596
597 void V8TestTypedefs::derefObject(void* object) 597 void V8TestTypedefs::derefObject(void* object)
598 { 598 {
599 fromInternalPointer(object)->deref(); 599 fromInternalPointer(object)->deref();
600 } 600 }
601 601
602 } // namespace WebCore 602 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestObjectPython.cpp ('k') | Source/bindings/v8/Dictionary.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698