| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 Handle<Object> script(fun_->shared()->script(), isolate_); | 185 Handle<Object> script(fun_->shared()->script(), isolate_); |
| 186 if (script->IsScript() && | 186 if (script->IsScript() && |
| 187 Handle<Script>::cast(script)->compilation_type() == | 187 Handle<Script>::cast(script)->compilation_type() == |
| 188 Script::COMPILATION_TYPE_EVAL) { | 188 Script::COMPILATION_TYPE_EVAL) { |
| 189 return isolate_->factory()->eval_string(); | 189 return isolate_->factory()->eval_string(); |
| 190 } | 190 } |
| 191 return isolate_->factory()->null_value(); | 191 return isolate_->factory()->null_value(); |
| 192 } | 192 } |
| 193 | 193 |
| 194 Handle<Object> CallSite::GetDebugName() { |
| 195 Handle<Object> name = JSReceiver::GetDataProperty( |
| 196 fun_, isolate_->factory()->display_name_string()); |
| 197 if (name->IsString() && String::cast(*name)->length() != 0) { |
| 198 return Handle<String>::cast(name); |
| 199 } |
| 200 return isolate_->factory()->null_value(); |
| 201 } |
| 194 | 202 |
| 195 Handle<Object> CallSite::GetScriptNameOrSourceUrl() { | 203 Handle<Object> CallSite::GetScriptNameOrSourceUrl() { |
| 196 Handle<Object> script_obj(fun_->shared()->script(), isolate_); | 204 Handle<Object> script_obj(fun_->shared()->script(), isolate_); |
| 197 if (script_obj->IsScript()) { | 205 if (script_obj->IsScript()) { |
| 198 Handle<Script> script = Handle<Script>::cast(script_obj); | 206 Handle<Script> script = Handle<Script>::cast(script_obj); |
| 199 Object* source_url = script->source_url(); | 207 Object* source_url = script->source_url(); |
| 200 if (source_url->IsString()) return Handle<Object>(source_url, isolate_); | 208 if (source_url->IsString()) return Handle<Object>(source_url, isolate_); |
| 201 return Handle<Object>(script->name(), isolate_); | 209 return Handle<Object>(script->name(), isolate_); |
| 202 } | 210 } |
| 203 return isolate_->factory()->null_value(); | 211 return isolate_->factory()->null_value(); |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 builder.AppendCharacter(*c); | 408 builder.AppendCharacter(*c); |
| 401 } | 409 } |
| 402 } | 410 } |
| 403 | 411 |
| 404 return builder.Finish(); | 412 return builder.Finish(); |
| 405 } | 413 } |
| 406 | 414 |
| 407 | 415 |
| 408 } // namespace internal | 416 } // namespace internal |
| 409 } // namespace v8 | 417 } // namespace v8 |
| OLD | NEW |