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

Side by Side Diff: Source/bindings/core/v8/V8PerIsolateData.cpp

Issue 1036803002: binidngs: Make callInternalFunction return MaybeLocal (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 // changes to the Function prototype chain or toString function are 235 // changes to the Function prototype chain or toString function are
236 // reflected when printing DOM constructors. The only wart is that 236 // reflected when printing DOM constructors. The only wart is that
237 // changes to a DOM constructor's toString's toString will cause the 237 // changes to a DOM constructor's toString's toString will cause the
238 // toString of the DOM constructor itself to change. This is extremely 238 // toString of the DOM constructor itself to change. This is extremely
239 // obscure and unlikely to be a problem. 239 // obscure and unlikely to be a problem.
240 v8::Handle<v8::Value> value = info.Callee()->Get(v8AtomicString(info.GetIsol ate(), "toString")); 240 v8::Handle<v8::Value> value = info.Callee()->Get(v8AtomicString(info.GetIsol ate(), "toString"));
241 if (!value->IsFunction()) { 241 if (!value->IsFunction()) {
242 v8SetReturnValue(info, v8::String::Empty(info.GetIsolate())); 242 v8SetReturnValue(info, v8::String::Empty(info.GetIsolate()));
243 return; 243 return;
244 } 244 }
245 v8SetReturnValue(info, V8ScriptRunner::callInternalFunction(v8::Handle<v8::F unction>::Cast(value), info.This(), 0, 0, info.GetIsolate())); 245 v8::Local<v8::Value> result;
246 if (!V8ScriptRunner::callInternalFunction(v8::Handle<v8::Function>::Cast(val ue), info.This(), 0, 0, info.GetIsolate()).ToLocal(&result))
yurys 2015/03/31 07:20:20 If we fail to get a valid result there must be a p
bashi 2015/04/01 01:51:27 Changed not to set return value on failure.
247 result = v8::String::Empty(info.GetIsolate());
248 v8SetReturnValue(info, result);
246 } 249 }
247 250
248 v8::Handle<v8::FunctionTemplate> V8PerIsolateData::toStringTemplate() 251 v8::Handle<v8::FunctionTemplate> V8PerIsolateData::toStringTemplate()
249 { 252 {
250 if (m_toStringTemplate.isEmpty()) 253 if (m_toStringTemplate.isEmpty())
251 m_toStringTemplate.set(isolate(), v8::FunctionTemplate::New(isolate(), c onstructorOfToString)); 254 m_toStringTemplate.set(isolate(), v8::FunctionTemplate::New(isolate(), c onstructorOfToString));
252 return m_toStringTemplate.newLocal(isolate()); 255 return m_toStringTemplate.newLocal(isolate());
253 } 256 }
254 257
255 void V8PerIsolateData::addEndOfScopeTask(PassOwnPtr<EndOfScopeTask> task) 258 void V8PerIsolateData::addEndOfScopeTask(PassOwnPtr<EndOfScopeTask> task)
(...skipping 15 matching lines...) Expand all
271 m_endOfScopeTasks.clear(); 274 m_endOfScopeTasks.clear();
272 } 275 }
273 276
274 void V8PerIsolateData::setScriptDebugServer(PassOwnPtrWillBeRawPtr<ScriptDebugSe rver> server) 277 void V8PerIsolateData::setScriptDebugServer(PassOwnPtrWillBeRawPtr<ScriptDebugSe rver> server)
275 { 278 {
276 ASSERT(!m_debugServer); 279 ASSERT(!m_debugServer);
277 m_debugServer = server; 280 m_debugServer = server;
278 } 281 }
279 282
280 } // namespace blink 283 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698