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: --harmony-async-await | |
6 | |
7 var Debug = debug.Debug; | 5 var Debug = debug.Debug; |
8 | 6 |
9 function assertEqualsAsync(expected, run, msg) { | 7 function assertEqualsAsync(expected, run, msg) { |
10 var actual; | 8 var actual; |
11 var hadValue = false; | 9 var hadValue = false; |
12 var hadError = false; | 10 var hadError = false; |
13 var promise = run(); | 11 var promise = run(); |
14 | 12 |
15 if (typeof promise !== "object" || typeof promise.then !== "function") { | 13 if (typeof promise !== "object" || typeof promise.then !== "function") { |
16 throw new MjsUnitAssertionError( | 14 throw new MjsUnitAssertionError( |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 Debug.setBreakPoint(f, 5); | 64 Debug.setBreakPoint(f, 5); |
67 | 65 |
68 f(); | 66 f(); |
69 | 67 |
70 %RunMicrotasks(); | 68 %RunMicrotasks(); |
71 | 69 |
72 assertEqualsAsync(3, async () => break_count); | 70 assertEqualsAsync(3, async () => break_count); |
73 assertEqualsAsync(null, async () => exception); | 71 assertEqualsAsync(null, async () => exception); |
74 | 72 |
75 Debug.setListener(null); | 73 Debug.setListener(null); |
OLD | NEW |