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