| 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..32b87fdbc44418b76bcb53d73507272493dbd801 100644
|
| --- a/Source/bindings/modules/v8/custom/V8DeviceMotionEventCustom.cpp
|
| +++ b/Source/bindings/modules/v8/custom/V8DeviceMotionEventCustom.cpp
|
| @@ -39,8 +39,9 @@ DeviceMotionData::Acceleration* readAccelerationArgument(v8::Local<v8::Value> va
|
| 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;
|
| + if (!value->ToObject(isolate->GetCurrentContext()).ToLocal(&object))
|
| + return nullptr;
|
|
|
| v8::Local<v8::Value> xValue = object->Get(v8AtomicString(isolate, "x"));
|
| if (xValue.IsEmpty())
|
| @@ -71,8 +72,9 @@ DeviceMotionData::RotationRate* readRotationRateArgument(v8::Local<v8::Value> va
|
| 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;
|
| + if (!value->ToObject(isolate->GetCurrentContext()).ToLocal(&object))
|
| + return nullptr;
|
|
|
| v8::Local<v8::Value> alphaValue = object->Get(v8AtomicString(isolate, "alpha"));
|
| if (alphaValue.IsEmpty())
|
|
|