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

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, 9 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 // changes to the Function prototype chain or toString function are 234 // changes to the Function prototype chain or toString function are
235 // reflected when printing DOM constructors. The only wart is that 235 // reflected when printing DOM constructors. The only wart is that
236 // changes to a DOM constructor's toString's toString will cause the 236 // changes to a DOM constructor's toString's toString will cause the
237 // toString of the DOM constructor itself to change. This is extremely 237 // toString of the DOM constructor itself to change. This is extremely
238 // obscure and unlikely to be a problem. 238 // obscure and unlikely to be a problem.
239 v8::Handle<v8::Value> value = info.Callee()->Get(v8AtomicString(info.GetIsol ate(), "toString")); 239 v8::Handle<v8::Value> value = info.Callee()->Get(v8AtomicString(info.GetIsol ate(), "toString"));
240 if (!value->IsFunction()) { 240 if (!value->IsFunction()) {
241 v8SetReturnValue(info, v8::String::Empty(info.GetIsolate())); 241 v8SetReturnValue(info, v8::String::Empty(info.GetIsolate()));
242 return; 242 return;
243 } 243 }
244 v8SetReturnValue(info, V8ScriptRunner::callInternalFunction(v8::Handle<v8::F unction>::Cast(value), info.This(), 0, 0, info.GetIsolate())); 244 v8::Local<v8::Value> result;
245 if (!V8ScriptRunner::callInternalFunction(v8::Handle<v8::Function>::Cast(val ue), info.This(), 0, 0, info.GetIsolate()).ToLocal(&result))
246 result = v8::String::Empty(info.GetIsolate());
247 v8SetReturnValue(info, result);
245 } 248 }
246 249
247 v8::Handle<v8::FunctionTemplate> V8PerIsolateData::toStringTemplate() 250 v8::Handle<v8::FunctionTemplate> V8PerIsolateData::toStringTemplate()
248 { 251 {
249 if (m_toStringTemplate.isEmpty()) 252 if (m_toStringTemplate.isEmpty())
250 m_toStringTemplate.set(isolate(), v8::FunctionTemplate::New(isolate(), c onstructorOfToString)); 253 m_toStringTemplate.set(isolate(), v8::FunctionTemplate::New(isolate(), c onstructorOfToString));
251 return m_toStringTemplate.newLocal(isolate()); 254 return m_toStringTemplate.newLocal(isolate());
252 } 255 }
253 256
254 void V8PerIsolateData::addEndOfScopeTask(PassOwnPtr<EndOfScopeTask> task) 257 void V8PerIsolateData::addEndOfScopeTask(PassOwnPtr<EndOfScopeTask> task)
(...skipping 15 matching lines...) Expand all
270 m_endOfScopeTasks.clear(); 273 m_endOfScopeTasks.clear();
271 } 274 }
272 275
273 void V8PerIsolateData::setScriptDebugServer(PassOwnPtrWillBeRawPtr<ScriptDebugSe rver> server) 276 void V8PerIsolateData::setScriptDebugServer(PassOwnPtrWillBeRawPtr<ScriptDebugSe rver> server)
274 { 277 {
275 ASSERT(!m_debugServer); 278 ASSERT(!m_debugServer);
276 m_debugServer = server; 279 m_debugServer = server;
277 } 280 }
278 281
279 } // namespace blink 282 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698