OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 stackTraceLimit = 10000; | 1083 stackTraceLimit = 10000; |
1084 } | 1084 } |
1085 var raw_stack = %CollectStackTrace(obj, | 1085 var raw_stack = %CollectStackTrace(obj, |
1086 cons_opt ? cons_opt : captureStackTrace, | 1086 cons_opt ? cons_opt : captureStackTrace, |
1087 stackTraceLimit); | 1087 stackTraceLimit); |
1088 // Note that 'obj' and 'this' maybe different when called on objects that | 1088 // Note that 'obj' and 'this' maybe different when called on objects that |
1089 // have the error object on its prototype chain. The getter replaces itself | 1089 // have the error object on its prototype chain. The getter replaces itself |
1090 // with a data property as soon as the stack trace has been formatted. | 1090 // with a data property as soon as the stack trace has been formatted. |
1091 var getter = function() { | 1091 var getter = function() { |
1092 var value = FormatRawStackTrace(obj, raw_stack); | 1092 var value = FormatRawStackTrace(obj, raw_stack); |
| 1093 raw_stack = void 0; |
1093 %DefineOrRedefineDataProperty(obj, 'stack', value, NONE); | 1094 %DefineOrRedefineDataProperty(obj, 'stack', value, NONE); |
1094 return value; | 1095 return value; |
1095 }; | 1096 }; |
1096 // The 'stack' property of the receiver is set as data property. If | 1097 // The 'stack' property of the receiver is set as data property. If |
1097 // the receiver is the same as holder, this accessor pair is replaced. | 1098 // the receiver is the same as holder, this accessor pair is replaced. |
1098 var setter = function(v) { | 1099 var setter = function(v) { |
1099 %DefineOrRedefineDataProperty(this, 'stack', v, NONE); | 1100 %DefineOrRedefineDataProperty(this, 'stack', v, NONE); |
1100 }; | 1101 }; |
1101 | 1102 |
1102 %DefineOrRedefineAccessorProperty(obj, 'stack', getter, setter, DONT_ENUM); | 1103 %DefineOrRedefineAccessorProperty(obj, 'stack', getter, setter, DONT_ENUM); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1258 %DefineOrRedefineDataProperty(this, 'stack', v, NONE); | 1259 %DefineOrRedefineDataProperty(this, 'stack', v, NONE); |
1259 } | 1260 } |
1260 | 1261 |
1261 %DefineOrRedefineAccessorProperty( | 1262 %DefineOrRedefineAccessorProperty( |
1262 boilerplate, 'stack', getter, setter, DONT_ENUM); | 1263 boilerplate, 'stack', getter, setter, DONT_ENUM); |
1263 | 1264 |
1264 return boilerplate; | 1265 return boilerplate; |
1265 } | 1266 } |
1266 | 1267 |
1267 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); | 1268 var kStackOverflowBoilerplate = SetUpStackOverflowBoilerplate(); |
OLD | NEW |