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

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

Issue 1067763002: bindings: Use Maybe version of Get in bindings/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 072b157dc9686792d78dda032eb14162d3b9870c..d9911862fe67dae89a361908e0a82f77dd8221f3 100644
--- a/Source/bindings/core/v8/V8NodeFilterCondition.cpp
+++ b/Source/bindings/core/v8/V8NodeFilterCondition.cpp
@@ -76,8 +76,13 @@ short V8NodeFilterCondition::acceptNode(Node* node, ExceptionState& exceptionSta
callback = v8::Local<v8::Function>::Cast(filter);
receiver = v8::Undefined(isolate);
} else {
- v8::Local<v8::Value> value = filter->ToObject(isolate)->Get(v8AtomicString(isolate, "acceptNode"));
- if (value.IsEmpty() || !value->IsFunction()) {
+ v8::Local<v8::Object> filterObject;
+ if (!filter->ToObject(m_scriptState->context()).ToLocal(&filterObject)) {
+ exceptionState.throwTypeError("NodeFilter is not an object");
+ return NodeFilter::FILTER_REJECT;
+ }
+ v8::Local<v8::Value> value;
+ if (!filterObject->Get(m_scriptState->context(), v8AtomicString(isolate, "acceptNode")).ToLocal(&value) || !value->IsFunction()) {
exceptionState.throwTypeError("NodeFilter object does not have an acceptNode function");
return NodeFilter::FILTER_REJECT;
}

Powered by Google App Engine
This is Rietveld 408576698