OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 | 388 |
389 Handle<String> RenderCallSite(Isolate* isolate, Handle<Object> object) { | 389 Handle<String> RenderCallSite(Isolate* isolate, Handle<Object> object) { |
390 MessageLocation location; | 390 MessageLocation location; |
391 if (ComputeLocation(isolate, &location)) { | 391 if (ComputeLocation(isolate, &location)) { |
392 Zone zone(isolate->allocator(), ZONE_NAME); | 392 Zone zone(isolate->allocator(), ZONE_NAME); |
393 std::unique_ptr<ParseInfo> info( | 393 std::unique_ptr<ParseInfo> info( |
394 location.function()->shared()->is_function() | 394 location.function()->shared()->is_function() |
395 ? new ParseInfo(&zone, handle(location.function()->shared())) | 395 ? new ParseInfo(&zone, handle(location.function()->shared())) |
396 : new ParseInfo(&zone, location.script())); | 396 : new ParseInfo(&zone, location.script())); |
397 if (Parser::ParseStatic(info.get())) { | 397 if (Parser::ParseStatic(info.get())) { |
398 CallPrinter printer(isolate, | 398 CallPrinter printer(isolate, location.function()->shared()->IsBuiltin()); |
399 location.function()->shared()->IsUserJavaScript()); | |
400 Handle<String> str = printer.Print(info->literal(), location.start_pos()); | 399 Handle<String> str = printer.Print(info->literal(), location.start_pos()); |
401 if (str->length() > 0) return str; | 400 if (str->length() > 0) return str; |
402 } else { | 401 } else { |
403 isolate->clear_pending_exception(); | 402 isolate->clear_pending_exception(); |
404 } | 403 } |
405 } | 404 } |
406 return Object::TypeOf(isolate, object); | 405 return Object::TypeOf(isolate, object); |
407 } | 406 } |
408 | 407 |
409 } // namespace | 408 } // namespace |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 | 533 |
535 RUNTIME_FUNCTION(Runtime_Typeof) { | 534 RUNTIME_FUNCTION(Runtime_Typeof) { |
536 HandleScope scope(isolate); | 535 HandleScope scope(isolate); |
537 DCHECK_EQ(1, args.length()); | 536 DCHECK_EQ(1, args.length()); |
538 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); | 537 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); |
539 return *Object::TypeOf(isolate, object); | 538 return *Object::TypeOf(isolate, object); |
540 } | 539 } |
541 | 540 |
542 } // namespace internal | 541 } // namespace internal |
543 } // namespace v8 | 542 } // namespace v8 |
OLD | NEW |