| 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 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 return MakeGenericError(GlobalTypeError, type, arg0, arg1, arg2); | 987 return MakeGenericError(GlobalTypeError, type, arg0, arg1, arg2); |
| 988 } | 988 } |
| 989 | 989 |
| 990 function MakeURIError() { | 990 function MakeURIError() { |
| 991 return MakeGenericError(GlobalURIError, kURIMalformed); | 991 return MakeGenericError(GlobalURIError, kURIMalformed); |
| 992 } | 992 } |
| 993 | 993 |
| 994 // Boilerplate for exceptions for stack overflows. Used from | 994 // Boilerplate for exceptions for stack overflows. Used from |
| 995 // Isolate::StackOverflow(). | 995 // Isolate::StackOverflow(). |
| 996 var StackOverflowBoilerplate = MakeRangeError(kStackOverflow); | 996 var StackOverflowBoilerplate = MakeRangeError(kStackOverflow); |
| 997 %DefineAccessorPropertyUnchecked(StackOverflowBoilerplate, 'stack', | 997 utils.InstallGetterSetter(StackOverflowBoilerplate, 'stack', |
| 998 StackTraceGetter, StackTraceSetter, | 998 StackTraceGetter, StackTraceSetter) |
| 999 DONT_ENUM); | |
| 1000 | 999 |
| 1001 // Define actual captureStackTrace function after everything has been set up. | 1000 // Define actual captureStackTrace function after everything has been set up. |
| 1002 captureStackTrace = function captureStackTrace(obj, cons_opt) { | 1001 captureStackTrace = function captureStackTrace(obj, cons_opt) { |
| 1003 // Define accessors first, as this may fail and throw. | 1002 // Define accessors first, as this may fail and throw. |
| 1004 ObjectDefineProperty(obj, 'stack', { get: StackTraceGetter, | 1003 ObjectDefineProperty(obj, 'stack', { get: StackTraceGetter, |
| 1005 set: StackTraceSetter, | 1004 set: StackTraceSetter, |
| 1006 configurable: true }); | 1005 configurable: true }); |
| 1007 %CollectStackTrace(obj, cons_opt ? cons_opt : captureStackTrace); | 1006 %CollectStackTrace(obj, cons_opt ? cons_opt : captureStackTrace); |
| 1008 }; | 1007 }; |
| 1009 | 1008 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1032 utils.Export(function(to) { | 1031 utils.Export(function(to) { |
| 1033 to.ErrorToString = ErrorToString; | 1032 to.ErrorToString = ErrorToString; |
| 1034 to.MakeError = MakeError; | 1033 to.MakeError = MakeError; |
| 1035 to.MakeRangeError = MakeRangeError; | 1034 to.MakeRangeError = MakeRangeError; |
| 1036 to.MakeSyntaxError = MakeSyntaxError; | 1035 to.MakeSyntaxError = MakeSyntaxError; |
| 1037 to.MakeTypeError = MakeTypeError; | 1036 to.MakeTypeError = MakeTypeError; |
| 1038 to.MakeURIError = MakeURIError; | 1037 to.MakeURIError = MakeURIError; |
| 1039 }); | 1038 }); |
| 1040 | 1039 |
| 1041 }); | 1040 }); |
| OLD | NEW |