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

Unified Diff: Source/bindings/tests/results/modules/V8TestInterface5.cpp

Issue 860353002: IDL: Add toRestricted{Float,Double}() helpers to V8Binding.h (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add FIXME comment Created 5 years, 11 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/modules/V8TestInterface5.cpp
diff --git a/Source/bindings/tests/results/modules/V8TestInterface5.cpp b/Source/bindings/tests/results/modules/V8TestInterface5.cpp
index 3ec7816d285498b457235646ee89b9493909faad..bb2f3f3ceffadeecf764ed1a98967f4ac8d45e07 100644
--- a/Source/bindings/tests/results/modules/V8TestInterface5.cpp
+++ b/Source/bindings/tests/results/modules/V8TestInterface5.cpp
@@ -89,12 +89,7 @@ static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v
v8::Local<v8::Object> holder = info.Holder();
ExceptionState exceptionState(ExceptionState::SetterContext, "doubleAttribute", "TestInterface5", holder, info.GetIsolate());
TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
- TONATIVE_VOID_EXCEPTIONSTATE(double, cppValue, toDouble(v8Value, exceptionState), exceptionState);
- if (!std::isfinite(cppValue)) {
- exceptionState.throwTypeError("The provided double value is non-finite.");
- exceptionState.throwIfNeeded();
- return;
- }
+ TONATIVE_VOID_EXCEPTIONSTATE(double, cppValue, toRestrictedDouble(v8Value, exceptionState), exceptionState);
impl->setDoubleAttribute(cppValue);
}
@@ -124,12 +119,7 @@ static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8
v8::Local<v8::Object> holder = info.Holder();
ExceptionState exceptionState(ExceptionState::SetterContext, "floatAttribute", "TestInterface5", holder, info.GetIsolate());
TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
- TONATIVE_VOID_EXCEPTIONSTATE(float, cppValue, toFloat(v8Value, exceptionState), exceptionState);
- if (!std::isfinite(cppValue)) {
- exceptionState.throwTypeError("The provided float value is non-finite.");
- exceptionState.throwIfNeeded();
- return;
- }
+ TONATIVE_VOID_EXCEPTIONSTATE(float, cppValue, toRestrictedFloat(v8Value, exceptionState), exceptionState);
impl->setFloatAttribute(cppValue);
}
@@ -373,18 +363,8 @@ static void voidMethodDoubleArgFloatArgMethod(const v8::FunctionCallbackInfo<v8:
double doubleArg;
float floatArg;
{
- TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(doubleArg, toDouble(info[0], exceptionState), exceptionState);
- if (!std::isfinite(doubleArg)) {
- exceptionState.throwTypeError("double parameter 1 is non-finite.");
- exceptionState.throwIfNeeded();
- return;
- }
- TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(floatArg, toFloat(info[1], exceptionState), exceptionState);
- if (!std::isfinite(floatArg)) {
- exceptionState.throwTypeError("float parameter 2 is non-finite.");
- exceptionState.throwIfNeeded();
- return;
- }
+ TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(doubleArg, toRestrictedDouble(info[0], exceptionState), exceptionState);
+ TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(floatArg, toRestrictedFloat(info[1], exceptionState), exceptionState);
}
impl->voidMethodDoubleArgFloatArg(doubleArg, floatArg);
}
« Source/bindings/core/v8/V8Binding.cpp ('K') | « Source/bindings/tests/results/core/V8TestObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698