| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/messages.h" | 5 #include "src/messages.h" |
| 6 | 6 |
| 7 #include "src/api.h" | 7 #include "src/api.h" |
| 8 #include "src/execution.h" | 8 #include "src/execution.h" |
| 9 #include "src/isolate-inl.h" | 9 #include "src/isolate-inl.h" |
| 10 #include "src/string-builder.h" | 10 #include "src/string-builder.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 Handle<Object> CallSite::GetFileName() { | 161 Handle<Object> CallSite::GetFileName() { |
| 162 Handle<Object> script(fun_->shared()->script(), isolate_); | 162 Handle<Object> script(fun_->shared()->script(), isolate_); |
| 163 if (script->IsScript()) { | 163 if (script->IsScript()) { |
| 164 return Handle<Object>(Handle<Script>::cast(script)->name(), isolate_); | 164 return Handle<Object>(Handle<Script>::cast(script)->name(), isolate_); |
| 165 } | 165 } |
| 166 return isolate_->factory()->null_value(); | 166 return isolate_->factory()->null_value(); |
| 167 } | 167 } |
| 168 | 168 |
| 169 | 169 |
| 170 Handle<Object> CallSite::GetFunctionName() { | 170 Handle<Object> CallSite::GetFunctionName() { |
| 171 Handle<String> result = JSFunction::GetDebugName(fun_); | 171 Handle<String> result = JSFunction::GetName(fun_); |
| 172 if (result->length() != 0) return result; | 172 if (result->length() != 0) return result; |
| 173 |
| 173 Handle<Object> script(fun_->shared()->script(), isolate_); | 174 Handle<Object> script(fun_->shared()->script(), isolate_); |
| 174 if (script->IsScript() && | 175 if (script->IsScript() && |
| 175 Handle<Script>::cast(script)->compilation_type() == | 176 Handle<Script>::cast(script)->compilation_type() == |
| 176 Script::COMPILATION_TYPE_EVAL) { | 177 Script::COMPILATION_TYPE_EVAL) { |
| 177 return isolate_->factory()->eval_string(); | 178 return isolate_->factory()->eval_string(); |
| 178 } | 179 } |
| 179 return isolate_->factory()->null_value(); | 180 return isolate_->factory()->null_value(); |
| 180 } | 181 } |
| 181 | 182 |
| 182 | 183 |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 if (obj->IsUndefined()) return default_value; | 475 if (obj->IsUndefined()) return default_value; |
| 475 if (!obj->IsString()) { | 476 if (!obj->IsString()) { |
| 476 ASSIGN_RETURN_ON_EXCEPTION(isolate, obj, Object::ToString(isolate, obj), | 477 ASSIGN_RETURN_ON_EXCEPTION(isolate, obj, Object::ToString(isolate, obj), |
| 477 String); | 478 String); |
| 478 } | 479 } |
| 479 return Handle<String>::cast(obj); | 480 return Handle<String>::cast(obj); |
| 480 } | 481 } |
| 481 | 482 |
| 482 } // namespace internal | 483 } // namespace internal |
| 483 } // namespace v8 | 484 } // namespace v8 |
| OLD | NEW |