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