OLD | NEW |
| (Empty) |
1 // Copyright 2016 the V8 project authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 Error.prepareStackTrace = function(exception, frames) { | |
6 return frames[0].getEvalOrigin(); | |
7 } | |
8 | |
9 var source = "new Error()"; | |
10 var eval_origin; | |
11 var geval = eval; | |
12 var log = []; | |
13 | |
14 (function() { | |
15 log.push([geval(source).stack, "15:13"]); | |
16 log.push([geval(source).stack, "16:13"]); | |
17 log.push([geval(source).stack, "17:13"]); | |
18 })(); | |
19 | |
20 (function() { | |
21 log.push([eval(source).stack, "21:13"]); | |
22 log.push([eval(source).stack, "22:13"]); | |
23 log.push([eval(source).stack, "23:13"]); | |
24 })(); | |
25 | |
26 log.push([eval(source).stack, "26:11"]); | |
27 log.push([eval(source).stack, "27:11"]); | |
28 log.push([eval(source).stack, "28:11"]); | |
29 | |
30 Error.prepareStackTrace = undefined; | |
31 | |
32 for (var item of log) { | |
33 var stacktraceline = item[0]; | |
34 var expectation = item[1]; | |
35 var re = new RegExp(`:${expectation}\\)$`); | |
36 assertTrue(re.test(stacktraceline)); | |
37 } | |
OLD | NEW |