| Index: Source/bindings/v8/custom/V8DeviceMotionEventCustom.cpp
|
| diff --git a/Source/bindings/v8/custom/V8DeviceMotionEventCustom.cpp b/Source/bindings/v8/custom/V8DeviceMotionEventCustom.cpp
|
| index e4a011c1b9fd9084baf86475532926a6b901b8a7..611a9ed82931b3bd35416661e93670d0ab697053 100644
|
| --- a/Source/bindings/v8/custom/V8DeviceMotionEventCustom.cpp
|
| +++ b/Source/bindings/v8/custom/V8DeviceMotionEventCustom.cpp
|
| @@ -37,31 +37,31 @@ namespace {
|
| PassRefPtrWillBeRawPtr<DeviceMotionData::Acceleration> readAccelerationArgument(v8::Local<v8::Value> value, v8::Isolate* isolate)
|
| {
|
| if (isUndefinedOrNull(value))
|
| - return 0;
|
| + return nullptr;
|
|
|
| // Given the test above, this will always yield an object.
|
| v8::Local<v8::Object> object = value->ToObject();
|
|
|
| v8::Local<v8::Value> xValue = object->Get(v8AtomicString(isolate, "x"));
|
| if (xValue.IsEmpty())
|
| - return 0;
|
| + return nullptr;
|
| bool canProvideX = !isUndefinedOrNull(xValue);
|
| double x = xValue->NumberValue();
|
|
|
| v8::Local<v8::Value> yValue = object->Get(v8AtomicString(isolate, "y"));
|
| if (yValue.IsEmpty())
|
| - return 0;
|
| + return nullptr;
|
| bool canProvideY = !isUndefinedOrNull(yValue);
|
| double y = yValue->NumberValue();
|
|
|
| v8::Local<v8::Value> zValue = object->Get(v8AtomicString(isolate, "z"));
|
| if (zValue.IsEmpty())
|
| - return 0;
|
| + return nullptr;
|
| bool canProvideZ = !isUndefinedOrNull(zValue);
|
| double z = zValue->NumberValue();
|
|
|
| if (!canProvideX && !canProvideY && !canProvideZ)
|
| - return 0;
|
| + return nullptr;
|
|
|
| return DeviceMotionData::Acceleration::create(canProvideX, x, canProvideY, y, canProvideZ, z);
|
| }
|
| @@ -69,31 +69,31 @@ PassRefPtrWillBeRawPtr<DeviceMotionData::Acceleration> readAccelerationArgument(
|
| PassRefPtrWillBeRawPtr<DeviceMotionData::RotationRate> readRotationRateArgument(v8::Local<v8::Value> value, v8::Isolate* isolate)
|
| {
|
| if (isUndefinedOrNull(value))
|
| - return 0;
|
| + return nullptr;
|
|
|
| // Given the test above, this will always yield an object.
|
| v8::Local<v8::Object> object = value->ToObject();
|
|
|
| v8::Local<v8::Value> alphaValue = object->Get(v8AtomicString(isolate, "alpha"));
|
| if (alphaValue.IsEmpty())
|
| - return 0;
|
| + return nullptr;
|
| bool canProvideAlpha = !isUndefinedOrNull(alphaValue);
|
| double alpha = alphaValue->NumberValue();
|
|
|
| v8::Local<v8::Value> betaValue = object->Get(v8AtomicString(isolate, "beta"));
|
| if (betaValue.IsEmpty())
|
| - return 0;
|
| + return nullptr;
|
| bool canProvideBeta = !isUndefinedOrNull(betaValue);
|
| double beta = betaValue->NumberValue();
|
|
|
| v8::Local<v8::Value> gammaValue = object->Get(v8AtomicString(isolate, "gamma"));
|
| if (gammaValue.IsEmpty())
|
| - return 0;
|
| + return nullptr;
|
| bool canProvideGamma = !isUndefinedOrNull(gammaValue);
|
| double gamma = gammaValue->NumberValue();
|
|
|
| if (!canProvideAlpha && !canProvideBeta && !canProvideGamma)
|
| - return 0;
|
| + return nullptr;
|
|
|
| return DeviceMotionData::RotationRate::create(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma);
|
| }
|
|
|