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 InspectorTest.addScript( | 5 let {session, contextGroup, Protocol} = InspectorTest.start('Tests that suspende
d generators produce scopes'); |
| 6 |
| 7 contextGroup.addScript( |
6 `function *gen(a) { | 8 `function *gen(a) { |
7 var b = 42; | 9 var b = 42; |
8 yield a; | 10 yield a; |
9 return b; | 11 return b; |
10 } | 12 } |
11 function testSuspendedGenerator() | 13 function testSuspendedGenerator() |
12 { | 14 { |
13 var g = gen(420); | 15 var g = gen(420); |
14 g.next(); | 16 g.next(); |
15 | 17 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 }, | 72 }, |
71 | 73 |
72 function testScopesNonPaused(next) { | 74 function testScopesNonPaused(next) { |
73 Protocol.Runtime.evaluate({ expression : "gen(430)"}) | 75 Protocol.Runtime.evaluate({ expression : "gen(430)"}) |
74 .then(msg => fetchGeneratorProperties(msg.result.result.objectId)) | 76 .then(msg => fetchGeneratorProperties(msg.result.result.objectId)) |
75 .then(dumpGeneratorScopes) | 77 .then(dumpGeneratorScopes) |
76 .then(next); | 78 .then(next); |
77 }, | 79 }, |
78 ]); | 80 ]); |
79 } | 81 } |
OLD | NEW |