Index: third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp |
diff --git a/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp b/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp |
index 76845d7e60c08053480cf3e3f3ae02b5a0a71988..2307f0acb2d3b43d908dcb2f58cbbcb066cebc84 100644 |
--- a/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp |
+++ b/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp |
@@ -345,7 +345,7 @@ void MainThreadDebugger::querySelectorCallback(const v8::FunctionCallbackInfo<v8 |
return; |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "$", "CommandLineAPI", info.Holder(), info.GetIsolate()); |
Element* element = toContainerNode(node)->querySelector(AtomicString(selector), exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) |
return; |
if (element) |
info.GetReturnValue().Set(toV8(element, info.Holder(), info.GetIsolate())); |
@@ -366,7 +366,7 @@ void MainThreadDebugger::querySelectorAllCallback(const v8::FunctionCallbackInfo |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "$$", "CommandLineAPI", info.Holder(), info.GetIsolate()); |
// toV8(elementList) doesn't work here, since we need a proper Array instance, not NodeList. |
StaticElementList* elementList = toContainerNode(node)->querySelectorAll(AtomicString(selector), exceptionState); |
- if (exceptionState.throwIfNeeded() || !elementList) |
+ if (exceptionState.hadException() || !elementList) |
return; |
v8::Isolate* isolate = info.GetIsolate(); |
v8::Local<v8::Context> context = isolate->GetCurrentContext(); |
@@ -392,7 +392,7 @@ void MainThreadDebugger::xpathSelectorCallback(const v8::FunctionCallbackInfo<v8 |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "$x", "CommandLineAPI", info.Holder(), info.GetIsolate()); |
XPathResult* result = XPathEvaluator::create()->evaluate(selector, node, nullptr, XPathResult::kAnyType, ScriptValue(), exceptionState); |
- if (exceptionState.throwIfNeeded() || !result) |
+ if (exceptionState.hadException() || !result) |
return; |
if (result->resultType() == XPathResult::kNumberType) { |
info.GetReturnValue().Set(toV8(result->numberValue(exceptionState), info.Holder(), info.GetIsolate())); |
@@ -406,14 +406,13 @@ void MainThreadDebugger::xpathSelectorCallback(const v8::FunctionCallbackInfo<v8 |
v8::Local<v8::Array> nodes = v8::Array::New(isolate); |
size_t index = 0; |
while (Node* node = result->iterateNext(exceptionState)) { |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) |
return; |
if (!createDataPropertyInArray(context, nodes, index++, toV8(node, info.Holder(), info.GetIsolate())).FromMaybe(false)) |
return; |
} |
info.GetReturnValue().Set(nodes); |
} |
- exceptionState.throwIfNeeded(); |
} |
} // namespace blink |