| 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 // Flags: --expose-debug-as debug | |
| 6 | |
| 7 var failure = null; | |
| 8 var args; | |
| 9 | |
| 10 function listener(event, exec_state, event_data, data) { | |
| 11 if (event != debug.Debug.DebugEvent.Break) return; | |
| 12 try { | |
| 13 args = exec_state.frame(0).evaluate('arguments').value(); | |
| 14 } catch (e) { | |
| 15 failure = e; | |
| 16 } | |
| 17 } | |
| 18 | |
| 19 debug.Debug.setListener(listener); | |
| 20 | |
| 21 function* gen(a, b) { | |
| 22 debugger; | |
| 23 yield a; | |
| 24 yield b; | |
| 25 } | |
| 26 | |
| 27 var foo = gen(1, 2); | |
| 28 | |
| 29 foo.next() | |
| 30 assertEquals(2, args.length); | |
| 31 assertEquals(undefined, args[0]); | |
| 32 assertEquals(undefined, args[1]); | |
| 33 | |
| 34 foo.next() | |
| 35 assertEquals(2, args.length); | |
| 36 assertEquals(undefined, args[0]); | |
| 37 assertEquals(undefined, args[1]); | |
| 38 | |
| 39 foo.next() | |
| 40 assertEquals(2, args.length); | |
| 41 assertEquals(undefined, args[0]); | |
| 42 assertEquals(undefined, args[1]); | |
| 43 | |
| 44 assertNull(failure); | |
| OLD | NEW |