Index: third_party/WebKit/Source/bindings/core/v8/custom/V8IntersectionObserverCustom.cpp |
diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8IntersectionObserverCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8IntersectionObserverCustom.cpp |
index c6bbfce265b1d4c344b28ada36ae9e81e7ac32a7..623aef1b6e7e98d1b78dabe6902ff03b23551a96 100644 |
--- a/third_party/WebKit/Source/bindings/core/v8/custom/V8IntersectionObserverCustom.cpp |
+++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8IntersectionObserverCustom.cpp |
@@ -36,18 +36,14 @@ void V8IntersectionObserver::constructorCustom(const v8::FunctionCallbackInfo<v8 |
IntersectionObserverInit intersectionObserverInit; |
ExceptionState exceptionState(ExceptionState::ConstructionContext, "Intersection", info.Holder(), info.GetIsolate()); |
V8IntersectionObserverInit::toImpl(info.GetIsolate(), info[1], intersectionObserverInit, exceptionState); |
- if (exceptionState.hadException()) { |
- V8ThrowException::throwGeneralError(info.GetIsolate(), exceptionState.message()); |
+ if (exceptionState.throwIfNeeded()) |
return; |
- } |
IntersectionObserverCallback* callback = new V8IntersectionObserverCallback(v8::Local<v8::Function>::Cast(info[0]), wrapper, ScriptState::current(info.GetIsolate())); |
IntersectionObserver* observer = IntersectionObserver::create(intersectionObserverInit, *callback, exceptionState); |
- if (!observer || exceptionState.hadException()) { |
- V8ThrowException::throwGeneralError(info.GetIsolate(), exceptionState.message()); |
+ if (exceptionState.throwIfNeeded()) |
return; |
- } |
- |
+ ASSERT(observer); |
v8SetReturnValue(info, V8DOMWrapper::associateObjectWithWrapper(info.GetIsolate(), observer, &wrapperTypeInfo, wrapper)); |
} |