| Index: Source/bindings/modules/v8/custom/V8DeviceMotionEventCustom.cpp
|
| diff --git a/Source/bindings/modules/v8/custom/V8DeviceMotionEventCustom.cpp b/Source/bindings/modules/v8/custom/V8DeviceMotionEventCustom.cpp
|
| index be8d12d3809aa2d30125558c971a5792ca2eb8dc..20b7077a17e2e20095f9603bc7ba179c208eeee4 100644
|
| --- a/Source/bindings/modules/v8/custom/V8DeviceMotionEventCustom.cpp
|
| +++ b/Source/bindings/modules/v8/custom/V8DeviceMotionEventCustom.cpp
|
| @@ -34,13 +34,13 @@ namespace blink {
|
|
|
| namespace {
|
|
|
| -DeviceMotionData::Acceleration* readAccelerationArgument(v8::Local<v8::Value> value, v8::Isolate* isolate)
|
| +DeviceMotionData::Acceleration* readAccelerationArgument(v8::Local<v8::Value> value, v8::Isolate* isolate, ExceptionState& exceptionState)
|
| {
|
| if (isUndefinedOrNull(value))
|
| return nullptr;
|
|
|
| - // Given the test above, this will always yield an object.
|
| - v8::Local<v8::Object> object = value->ToObject(isolate);
|
| + v8::Local<v8::Object> object;
|
| + CALL_V8_MAYBELOCAL(object, isolate, value->ToObject(isolate->GetCurrentContext()), exceptionState, nullptr);
|
|
|
| v8::Local<v8::Value> xValue = object->Get(v8AtomicString(isolate, "x"));
|
| if (xValue.IsEmpty())
|
| @@ -66,13 +66,13 @@ DeviceMotionData::Acceleration* readAccelerationArgument(v8::Local<v8::Value> va
|
| return DeviceMotionData::Acceleration::create(canProvideX, x, canProvideY, y, canProvideZ, z);
|
| }
|
|
|
| -DeviceMotionData::RotationRate* readRotationRateArgument(v8::Local<v8::Value> value, v8::Isolate* isolate)
|
| +DeviceMotionData::RotationRate* readRotationRateArgument(v8::Local<v8::Value> value, v8::Isolate* isolate, ExceptionState& exceptionState)
|
| {
|
| if (isUndefinedOrNull(value))
|
| return nullptr;
|
|
|
| - // Given the test above, this will always yield an object.
|
| - v8::Local<v8::Object> object = value->ToObject(isolate);
|
| + v8::Local<v8::Object> object;
|
| + CALL_V8_MAYBELOCAL(object, isolate, value->ToObject(isolate->GetCurrentContext()), exceptionState, nullptr);
|
|
|
| v8::Local<v8::Value> alphaValue = object->Get(v8AtomicString(isolate, "alpha"));
|
| if (alphaValue.IsEmpty())
|
| @@ -110,9 +110,12 @@ void V8DeviceMotionEvent::initDeviceMotionEventMethodCustom(const v8::FunctionCa
|
| return;
|
| bool bubbles = info[1]->BooleanValue();
|
| bool cancelable = info[2]->BooleanValue();
|
| - DeviceMotionData::Acceleration* acceleration = readAccelerationArgument(info[3], isolate);
|
| - DeviceMotionData::Acceleration* accelerationIncludingGravity = readAccelerationArgument(info[4], isolate);
|
| - DeviceMotionData::RotationRate* rotationRate = readRotationRateArgument(info[5], isolate);
|
| + DeviceMotionData::Acceleration* acceleration = readAccelerationArgument(info[3], isolate, exceptionState);
|
| + DeviceMotionData::Acceleration* accelerationIncludingGravity = readAccelerationArgument(info[4], isolate, exceptionState);
|
| + DeviceMotionData::RotationRate* rotationRate = readRotationRateArgument(info[5], isolate, exceptionState);
|
| + if (exceptionState.throwIfNeeded())
|
| + return;
|
| +
|
| bool intervalProvided = !isUndefinedOrNull(info[6]);
|
| double interval = 0;
|
| if (intervalProvided) {
|
|
|