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

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

Issue 105693002: Generate a bit less code to handle failed arity checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 { 368 {
369 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 369 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
370 TestTypedefsV8Internal::immutablePointFunctionMethod(info); 370 TestTypedefsV8Internal::immutablePointFunctionMethod(info);
371 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 371 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
372 } 372 }
373 373
374 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 374 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
375 { 375 {
376 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArray Function", "TestTypedefs", info.Holder(), info.GetIsolate()); 376 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArray Function", "TestTypedefs", info.Holder(), info.GetIsolate());
377 if (UNLIKELY(info.Length() < 1)) { 377 if (UNLIKELY(info.Length() < 1)) {
378 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction", "TestTypedefs", ExceptionMessages::notEnoughArguments(1, info.Length())), info. GetIsolate()); 378 exceptionState.notEnoughArguments(1, info.Length());
379 return; 379 return;
380 } 380 }
381 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); 381 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder());
382 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, in fo.GetIsolate())); 382 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, in fo.GetIsolate()));
383 Vector<String> result = imp->stringArrayFunction(values, exceptionState); 383 Vector<String> result = imp->stringArrayFunction(values, exceptionState);
384 if (exceptionState.throwIfNeeded()) 384 if (exceptionState.throwIfNeeded())
385 return; 385 return;
386 v8SetReturnValue(info, v8Array(result, info.GetIsolate())); 386 v8SetReturnValue(info, v8Array(result, info.GetIsolate()));
387 } 387 }
388 388
389 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info) 389 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info)
390 { 390 {
391 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 391 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
392 TestTypedefsV8Internal::stringArrayFunctionMethod(info); 392 TestTypedefsV8Internal::stringArrayFunctionMethod(info);
393 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 393 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
394 } 394 }
395 395
396 static void stringArrayFunction2Method(const v8::FunctionCallbackInfo<v8::Value> & info) 396 static void stringArrayFunction2Method(const v8::FunctionCallbackInfo<v8::Value> & info)
397 { 397 {
398 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArray Function2", "TestTypedefs", info.Holder(), info.GetIsolate()); 398 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArray Function2", "TestTypedefs", info.Holder(), info.GetIsolate());
399 if (UNLIKELY(info.Length() < 1)) { 399 if (UNLIKELY(info.Length() < 1)) {
400 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction2" , "TestTypedefs", ExceptionMessages::notEnoughArguments(1, info.Length())), info .GetIsolate()); 400 exceptionState.notEnoughArguments(1, info.Length());
401 return; 401 return;
402 } 402 }
403 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); 403 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder());
404 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, in fo.GetIsolate())); 404 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, in fo.GetIsolate()));
405 Vector<String> result = imp->stringArrayFunction2(values, exceptionState); 405 Vector<String> result = imp->stringArrayFunction2(values, exceptionState);
406 if (exceptionState.throwIfNeeded()) 406 if (exceptionState.throwIfNeeded())
407 return; 407 return;
408 v8SetReturnValue(info, v8Array(result, info.GetIsolate())); 408 v8SetReturnValue(info, v8Array(result, info.GetIsolate()));
409 } 409 }
410 410
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 fromInternalPointer(object)->deref(); 565 fromInternalPointer(object)->deref();
566 } 566 }
567 567
568 template<> 568 template<>
569 v8::Handle<v8::Value> toV8NoInline(TestTypedefs* impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate) 569 v8::Handle<v8::Value> toV8NoInline(TestTypedefs* impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate)
570 { 570 {
571 return toV8(impl, creationContext, isolate); 571 return toV8(impl, creationContext, isolate);
572 } 572 }
573 573
574 } // namespace WebCore 574 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698