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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 return Script::GetColumnNumber(script, pos_) + 1; | 271 return Script::GetColumnNumber(script, pos_) + 1; |
272 } | 272 } |
273 } | 273 } |
274 return -1; | 274 return -1; |
275 } | 275 } |
276 | 276 |
277 | 277 |
278 bool CallSite::IsNative() { | 278 bool CallSite::IsNative() { |
279 Handle<Object> script(fun_->shared()->script(), isolate_); | 279 Handle<Object> script(fun_->shared()->script(), isolate_); |
280 return script->IsScript() && | 280 return script->IsScript() && |
281 Handle<Script>::cast(script)->type()->value() == Script::TYPE_NATIVE; | 281 Handle<Script>::cast(script)->type() == Script::TYPE_NATIVE; |
282 } | 282 } |
283 | 283 |
284 | 284 |
285 bool CallSite::IsToplevel() { | 285 bool CallSite::IsToplevel() { |
286 return receiver_->IsJSGlobalProxy() || receiver_->IsNull() || | 286 return receiver_->IsJSGlobalProxy() || receiver_->IsNull() || |
287 receiver_->IsUndefined(); | 287 receiver_->IsUndefined(); |
288 } | 288 } |
289 | 289 |
290 | 290 |
291 bool CallSite::IsEval() { | 291 bool CallSite::IsEval() { |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 if (obj->IsUndefined()) return default_value; | 473 if (obj->IsUndefined()) return default_value; |
474 if (!obj->IsString()) { | 474 if (!obj->IsString()) { |
475 ASSIGN_RETURN_ON_EXCEPTION(isolate, obj, Object::ToString(isolate, obj), | 475 ASSIGN_RETURN_ON_EXCEPTION(isolate, obj, Object::ToString(isolate, obj), |
476 String); | 476 String); |
477 } | 477 } |
478 return Handle<String>::cast(obj); | 478 return Handle<String>::cast(obj); |
479 } | 479 } |
480 | 480 |
481 } // namespace internal | 481 } // namespace internal |
482 } // namespace v8 | 482 } // namespace v8 |
OLD | NEW |