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

Unified Diff: Source/bindings/tests/results/core/V8TestTypedefs.cpp

Issue 567503002: Add toDouble() helper, and use toFloat()/toDouble() for conversions (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/bindings/tests/results/core/V8TestTypedefs.cpp
diff --git a/Source/bindings/tests/results/core/V8TestTypedefs.cpp b/Source/bindings/tests/results/core/V8TestTypedefs.cpp
index 0986be7207f35309bb1118569bb9f76f3023b209..79824f7f9b7f09d1a1d9e452f7ee87cdbf7f7a50 100644
--- a/Source/bindings/tests/results/core/V8TestTypedefs.cpp
+++ b/Source/bindings/tests/results/core/V8TestTypedefs.cpp
@@ -111,17 +111,17 @@ static void voidMethodArrayOfLongsArgMethodCallback(const v8::FunctionCallbackIn
static void voidMethodFloatArgStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodFloatArgStringArg", "TestTypedefs", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 2)) {
- V8ThrowException::throwException(createMinimumArityTypeErrorForMethod("voidMethodFloatArgStringArg", "TestTypedefs", 2, info.Length(), info.GetIsolate()), info.GetIsolate());
+ setMinimumArityTypeError(exceptionState, 2, info.Length());
+ exceptionState.throwIfNeeded();
return;
}
TestTypedefs* impl = V8TestTypedefs::toImpl(info.Holder());
float floatArg;
V8StringResource<> stringArg;
{
- v8::TryCatch block;
- V8RethrowTryCatchScope rethrow(block);
- TONATIVE_VOID_INTERNAL(floatArg, static_cast<float>(info[0]->NumberValue()));
+ TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(floatArg, toFloat(info[0], exceptionState), exceptionState);
TOSTRING_VOID_INTERNAL(stringArg, info[1]);
}
impl->voidMethodFloatArgStringArg(floatArg, stringArg);

Powered by Google App Engine
This is Rietveld 408576698