| 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 | |
| 6 | 5 |
| 7 // Test that debug-evaluate only resolves variables that are used by | 6 // Test that debug-evaluate only resolves variables that are used by |
| 8 // the function inside which we debug-evaluate. This is to avoid | 7 // the function inside which we debug-evaluate. This is to avoid |
| 9 // incorrect variable resolution when a context-allocated variable is | 8 // incorrect variable resolution when a context-allocated variable is |
| 10 // shadowed by a stack-allocated variable. | 9 // shadowed by a stack-allocated variable. |
| 11 | 10 |
| 12 "use strict"; | 11 "use strict"; |
| 13 | 12 |
| 14 var Debug = debug.Debug | 13 var Debug = debug.Debug |
| 15 | 14 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 35 debugger; | 34 debugger; |
| 36 })(); | 35 })(); |
| 37 | 36 |
| 38 assertEquals(2, x); // declaration | 37 assertEquals(2, x); // declaration |
| 39 assertThrows(() => y, ReferenceError); // let-declaration does not stick | 38 assertThrows(() => y, ReferenceError); // let-declaration does not stick |
| 40 assertEquals(4, z); // re-declaration | 39 assertEquals(4, z); // re-declaration |
| 41 assertEquals(5, bar()); // function declaration | 40 assertEquals(5, bar()); // function declaration |
| 42 | 41 |
| 43 Debug.setListener(null); | 42 Debug.setListener(null); |
| 44 assertNull(exception); | 43 assertNull(exception); |
| OLD | NEW |