Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |