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 var kMessages = { | 7 var kMessages = { |
8 // Error | 8 // Error |
9 cyclic_proto: ["Cyclic __proto__ value"], | 9 cyclic_proto: ["Cyclic __proto__ value"], |
10 code_gen_from_strings: ["%0"], | 10 code_gen_from_strings: ["%0"], |
(...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 SET_PRIVATE(this, formatted_stack_trace_symbol, v); | 1137 SET_PRIVATE(this, formatted_stack_trace_symbol, v); |
1138 } | 1138 } |
1139 }; | 1139 }; |
1140 | 1140 |
1141 | 1141 |
1142 // Use a dummy function since we do not actually want to capture a stack trace | 1142 // Use a dummy function since we do not actually want to capture a stack trace |
1143 // when constructing the initial Error prototytpes. | 1143 // when constructing the initial Error prototytpes. |
1144 var captureStackTrace = function captureStackTrace(obj, cons_opt) { | 1144 var captureStackTrace = function captureStackTrace(obj, cons_opt) { |
1145 // Define accessors first, as this may fail and throw. | 1145 // Define accessors first, as this may fail and throw. |
1146 ObjectDefineProperty(obj, 'stack', { get: StackTraceGetter, | 1146 ObjectDefineProperty(obj, 'stack', { get: StackTraceGetter, |
1147 set: StackTraceSetter}); | 1147 set: StackTraceSetter, |
| 1148 configurable: true }); |
1148 %CollectStackTrace(obj, cons_opt ? cons_opt : captureStackTrace); | 1149 %CollectStackTrace(obj, cons_opt ? cons_opt : captureStackTrace); |
1149 } | 1150 } |
1150 | 1151 |
1151 | 1152 |
1152 function SetUpError() { | 1153 function SetUpError() { |
1153 // Define special error type constructors. | 1154 // Define special error type constructors. |
1154 | 1155 |
1155 var DefineError = function(f) { | 1156 var DefineError = function(f) { |
1156 // Store the error function in both the global object | 1157 // Store the error function in both the global object |
1157 // and the runtime object. The function is fetched | 1158 // and the runtime object. The function is fetched |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1281 function SetUpStackOverflowBoilerplate() { | 1282 function SetUpStackOverflowBoilerplate() { |
1282 var boilerplate = MakeRangeError('stack_overflow', []); | 1283 var boilerplate = MakeRangeError('stack_overflow', []); |
1283 | 1284 |
1284 %DefineAccessorPropertyUnchecked( | 1285 %DefineAccessorPropertyUnchecked( |
1285 boilerplate, 'stack', StackTraceGetter, StackTraceSetter, DONT_ENUM); | 1286 boilerplate, 'stack', StackTraceGetter, StackTraceSetter, DONT_ENUM); |
1286 | 1287 |
1287 return boilerplate; | 1288 return boilerplate; |
1288 } | 1289 } |
1289 | 1290 |
1290 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); | 1291 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); |
OLD | NEW |