| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 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 | 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 // Flags: --ignition --ignition-filter=f | 5 // Flags: --ignition --ignition-filter=f |
| 6 | 6 |
| 7 function f() { | 7 function f(x) { |
| 8 return new Error().stack; | 8 if (x == 0) { |
| 9 return new Error().stack; |
| 10 } |
| 11 return f(x - 1); |
| 9 } | 12 } |
| 10 | 13 |
| 11 // TODO(yangguo): this is just a dummy source position calculated for | 14 var stack_lines = f(2).split("\n"); |
| 12 // interpreter bytecode. Update this once something better comes along. | 15 |
| 13 assertTrue(/at f.*?:\d+:\d+/.test(f())); | 16 assertTrue(/at f \(.*?:9:12\)/.test(stack_lines[1])); |
| 17 assertTrue(/at f \(.*?:11:10\)/.test(stack_lines[2])); |
| 18 assertTrue(/at f \(.*?:11:10\)/.test(stack_lines[3])); |
| OLD | NEW |