Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Side by Side Diff: src/js/messages.js

Issue 2110683007: Use toString tag to format receiver in stack traces (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@20160629-builtin-exit-receiver
Patch Set: Rebase on master Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/runtime/runtime.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 // ------------------------------------------------------------------- 5 // -------------------------------------------------------------------
6 6
7 (function(global, utils) { 7 (function(global, utils) {
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 } 594 }
595 lines.push(" at " + line); 595 lines.push(" at " + line);
596 } 596 }
597 return %_Call(ArrayJoin, lines, "\n"); 597 return %_Call(ArrayJoin, lines, "\n");
598 } 598 }
599 599
600 600
601 function GetTypeName(receiver, requireConstructor) { 601 function GetTypeName(receiver, requireConstructor) {
602 if (IS_NULL_OR_UNDEFINED(receiver)) return null; 602 if (IS_NULL_OR_UNDEFINED(receiver)) return null;
603 if (IS_PROXY(receiver)) return "Proxy"; 603 if (IS_PROXY(receiver)) return "Proxy";
604 604 return %GetConstructorName(receiver);
605 var constructor = %GetDataProperty(TO_OBJECT(receiver), "constructor");
606 if (!IS_FUNCTION(constructor)) {
607 return requireConstructor ? null : %_Call(NoSideEffectsToString, receiver);
608 }
609 return %FunctionGetName(constructor);
610 } 605 }
611 606
612 607
613 // Format the stack trace if not yet done, and return it. 608 // Format the stack trace if not yet done, and return it.
614 // Cache the formatted stack trace on the holder. 609 // Cache the formatted stack trace on the holder.
615 var StackTraceGetter = function() { 610 var StackTraceGetter = function() {
616 var formatted_stack_trace = UNDEFINED; 611 var formatted_stack_trace = UNDEFINED;
617 var holder = this; 612 var holder = this;
618 while (holder) { 613 while (holder) {
619 var formatted_stack_trace = 614 var formatted_stack_trace =
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 utils.Export(function(to) { 758 utils.Export(function(to) {
764 to.ErrorToString = ErrorToString; 759 to.ErrorToString = ErrorToString;
765 to.MakeError = MakeError; 760 to.MakeError = MakeError;
766 to.MakeRangeError = MakeRangeError; 761 to.MakeRangeError = MakeRangeError;
767 to.MakeSyntaxError = MakeSyntaxError; 762 to.MakeSyntaxError = MakeSyntaxError;
768 to.MakeTypeError = MakeTypeError; 763 to.MakeTypeError = MakeTypeError;
769 to.MakeURIError = MakeURIError; 764 to.MakeURIError = MakeURIError;
770 }); 765 });
771 766
772 }); 767 });
OLDNEW
« no previous file with comments | « no previous file | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698