| 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 var LiveEdit = Debug.LiveEdit; | 6 var LiveEdit = Debug.LiveEdit; |
| 9 | 7 |
| 10 unique_id = 0; | 8 unique_id = 0; |
| 11 | 9 |
| 12 var AsyncFunction = (async function(){}).constructor; | 10 var AsyncFunction = (async function(){}).constructor; |
| 13 | 11 |
| 14 function assertPromiseValue(value, promise) { | 12 function assertPromiseValue(value, promise) { |
| 15 promise.then(resolve => { | 13 promise.then(resolve => { |
| 16 went = true; | 14 went = true; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 promise = asyncfn(function() { return fun_inside(attempt_fun_patches) }); | 121 promise = asyncfn(function() { return fun_inside(attempt_fun_patches) }); |
| 124 assertEquals('Cat', | 122 assertEquals('Cat', |
| 125 fun_outside(function () { | 123 fun_outside(function () { |
| 126 assertPromiseValue('Capybara', promise); | 124 assertPromiseValue('Capybara', promise); |
| 127 assertTrue(fun_patch_restarted); | 125 assertTrue(fun_patch_restarted); |
| 128 assertTrue(fun_inside.toString().includes("'Koala'")); | 126 assertTrue(fun_inside.toString().includes("'Koala'")); |
| 129 })); | 127 })); |
| 130 })(); | 128 })(); |
| 131 | 129 |
| 132 %RunMicrotasks(); | 130 %RunMicrotasks(); |
| OLD | NEW |