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(valu e), info.This(), 0, 0, info.GetIsolate()).ToLocal(&result)) | |
| 247 v8SetReturnValue(info, result); | |
|
haraken
2015/04/01 07:00:32
Not related to this CL, it seems better to set v8:
| |
| 246 } | 248 } |
| 247 | 249 |
| 248 v8::Handle<v8::FunctionTemplate> V8PerIsolateData::toStringTemplate() | 250 v8::Handle<v8::FunctionTemplate> V8PerIsolateData::toStringTemplate() |
| 249 { | 251 { |
| 250 if (m_toStringTemplate.isEmpty()) | 252 if (m_toStringTemplate.isEmpty()) |
| 251 m_toStringTemplate.set(isolate(), v8::FunctionTemplate::New(isolate(), c onstructorOfToString)); | 253 m_toStringTemplate.set(isolate(), v8::FunctionTemplate::New(isolate(), c onstructorOfToString)); |
| 252 return m_toStringTemplate.newLocal(isolate()); | 254 return m_toStringTemplate.newLocal(isolate()); |
| 253 } | 255 } |
| 254 | 256 |
| 255 void V8PerIsolateData::addEndOfScopeTask(PassOwnPtr<EndOfScopeTask> task) | 257 void V8PerIsolateData::addEndOfScopeTask(PassOwnPtr<EndOfScopeTask> task) |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 271 m_endOfScopeTasks.clear(); | 273 m_endOfScopeTasks.clear(); |
| 272 } | 274 } |
| 273 | 275 |
| 274 void V8PerIsolateData::setScriptDebugServer(PassOwnPtrWillBeRawPtr<ScriptDebugSe rver> server) | 276 void V8PerIsolateData::setScriptDebugServer(PassOwnPtrWillBeRawPtr<ScriptDebugSe rver> server) |
| 275 { | 277 { |
| 276 ASSERT(!m_debugServer); | 278 ASSERT(!m_debugServer); |
| 277 m_debugServer = server; | 279 m_debugServer = server; |
| 278 } | 280 } |
| 279 | 281 |
| 280 } // namespace blink | 282 } // namespace blink |
| OLD | NEW |