OLD | NEW |
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 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 } | 834 } |
835 } | 835 } |
836 lines.push(" at " + line); | 836 lines.push(" at " + line); |
837 } | 837 } |
838 return %_Call(ArrayJoin, lines, "\n"); | 838 return %_Call(ArrayJoin, lines, "\n"); |
839 } | 839 } |
840 | 840 |
841 | 841 |
842 function GetTypeName(receiver, requireConstructor) { | 842 function GetTypeName(receiver, requireConstructor) { |
843 if (IS_NULL_OR_UNDEFINED(receiver)) return null; | 843 if (IS_NULL_OR_UNDEFINED(receiver)) return null; |
844 if (%_IsJSProxy(receiver)) return "Proxy"; | 844 if (IS_PROXY(receiver)) return "Proxy"; |
845 | 845 |
846 var constructor = %GetDataProperty(TO_OBJECT(receiver), "constructor"); | 846 var constructor = %GetDataProperty(TO_OBJECT(receiver), "constructor"); |
847 if (!IS_FUNCTION(constructor)) { | 847 if (!IS_FUNCTION(constructor)) { |
848 return requireConstructor ? null : %_Call(NoSideEffectsToString, receiver); | 848 return requireConstructor ? null : %_Call(NoSideEffectsToString, receiver); |
849 } | 849 } |
850 return %FunctionGetName(constructor); | 850 return %FunctionGetName(constructor); |
851 } | 851 } |
852 | 852 |
853 | 853 |
854 // Format the stack trace if not yet done, and return it. | 854 // Format the stack trace if not yet done, and return it. |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1004 utils.Export(function(to) { | 1004 utils.Export(function(to) { |
1005 to.ErrorToString = ErrorToString; | 1005 to.ErrorToString = ErrorToString; |
1006 to.MakeError = MakeError; | 1006 to.MakeError = MakeError; |
1007 to.MakeRangeError = MakeRangeError; | 1007 to.MakeRangeError = MakeRangeError; |
1008 to.MakeSyntaxError = MakeSyntaxError; | 1008 to.MakeSyntaxError = MakeSyntaxError; |
1009 to.MakeTypeError = MakeTypeError; | 1009 to.MakeTypeError = MakeTypeError; |
1010 to.MakeURIError = MakeURIError; | 1010 to.MakeURIError = MakeURIError; |
1011 }); | 1011 }); |
1012 | 1012 |
1013 }); | 1013 }); |
OLD | NEW |