OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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: --expose-debug-as debug | 5 // Flags: --expose-debug-as debug --legacy-const |
6 | 6 |
7 function f(x) { | 7 function f(x) { |
8 // This function compiles into code that only throws a redeclaration | 8 // This function compiles into code that only throws a redeclaration |
9 // error. It contains no stack check and has no function body. | 9 // error. It contains no stack check and has no function body. |
10 const x = 0; | 10 const x = 0; |
11 return x; | 11 return x; |
12 } | 12 } |
13 | 13 |
14 function g() { | 14 function g() { |
15 f(0); | 15 f(0); |
(...skipping 12 matching lines...) Expand all Loading... |
28 } catch (e) { | 28 } catch (e) { |
29 exception = e; | 29 exception = e; |
30 } | 30 } |
31 } | 31 } |
32 | 32 |
33 Debug.setListener(listener); | 33 Debug.setListener(listener); |
34 | 34 |
35 assertThrows(g); | 35 assertThrows(g); |
36 assertNull(exception); | 36 assertNull(exception); |
37 assertTrue(called); | 37 assertTrue(called); |
OLD | NEW |