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

Unified Diff: Source/bindings/core/v8/V8PerIsolateData.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
« no previous file with comments | « Source/bindings/core/v8/V8PerContextData.cpp ('k') | Source/bindings/core/v8/V8ThrowException.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/V8PerIsolateData.cpp
diff --git a/Source/bindings/core/v8/V8PerIsolateData.cpp b/Source/bindings/core/v8/V8PerIsolateData.cpp
index 97586d6512cfa9543178783b2f017a0227dc3777..4bcab8bc08d7cbdd04938de990514993e7ca48bc 100644
--- a/Source/bindings/core/v8/V8PerIsolateData.cpp
+++ b/Source/bindings/core/v8/V8PerIsolateData.cpp
@@ -240,13 +240,14 @@ static void constructorOfToString(const v8::FunctionCallbackInfo<v8::Value>& inf
// changes to a DOM constructor's toString's toString will cause the
// toString of the DOM constructor itself to change. This is extremely
// obscure and unlikely to be a problem.
- v8::Handle<v8::Value> value = info.Callee()->Get(v8AtomicString(info.GetIsolate(), "toString"));
- if (!value->IsFunction()) {
- v8SetReturnValue(info, v8::String::Empty(info.GetIsolate()));
+ v8::Isolate* isolate = info.GetIsolate();
+ v8::Local<v8::Value> value;
+ if (!info.Callee()->Get(isolate->GetCurrentContext(), v8AtomicString(isolate, "toString")).ToLocal(&value) || !value->IsFunction()) {
+ v8SetReturnValue(info, v8::String::Empty(isolate));
return;
}
v8::Local<v8::Value> result;
- if (V8ScriptRunner::callInternalFunction(v8::Handle<v8::Function>::Cast(value), info.This(), 0, 0, info.GetIsolate()).ToLocal(&result))
+ if (V8ScriptRunner::callInternalFunction(v8::Handle<v8::Function>::Cast(value), info.This(), 0, 0, isolate).ToLocal(&result))
v8SetReturnValue(info, result);
}
« no previous file with comments | « Source/bindings/core/v8/V8PerContextData.cpp ('k') | Source/bindings/core/v8/V8ThrowException.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698