Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Unified Diff: Source/bindings/core/v8/V8NodeFilterCondition.cpp

Issue 1100223003: bindings: Add empty checks for toV8() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/bindings/core/v8/V8NodeFilterCondition.cpp
diff --git a/Source/bindings/core/v8/V8NodeFilterCondition.cpp b/Source/bindings/core/v8/V8NodeFilterCondition.cpp
index ef76e20a9aff98e639924c1b11343a007d700cb9..3128311990ce6080cfc986da6bd3839fb4915f89 100644
--- a/Source/bindings/core/v8/V8NodeFilterCondition.cpp
+++ b/Source/bindings/core/v8/V8NodeFilterCondition.cpp
@@ -92,6 +92,11 @@ short V8NodeFilterCondition::acceptNode(Node* node, ExceptionState& exceptionSta
OwnPtr<v8::Local<v8::Value>[]> info = adoptArrayPtr(new v8::Local<v8::Value>[1]);
info[0] = toV8(node, m_scriptState->context()->Global(), isolate);
+ if (info[0].IsEmpty()) {
+ if (exceptionCatcher.HasCaught())
haraken 2015/04/28 05:50:34 Do we need the HasCaught check?
bashi 2015/04/28 06:41:15 Ditto. toV8() can fail without exception.
+ exceptionState.rethrowV8Exception(exceptionCatcher.Exception());
+ return NodeFilter::FILTER_REJECT;
+ }
v8::Local<v8::Value> result;
if (!ScriptController::callFunction(m_scriptState->executionContext(), callback, receiver, 1, info.get(), isolate).ToLocal(&result)) {

Powered by Google App Engine
This is Rietveld 408576698