diff --git a/src/internal/scheduler.js b/src/internal/scheduler.js index 717a5c7ff4..6c62af905c 100644 --- a/src/internal/scheduler.js +++ b/src/internal/scheduler.js @@ -10,7 +10,8 @@ const render_callbacks = []; export function schedule_update() { if (!update_promise) { - update_promise = Promise.resolve().then(flush); + update_promise = Promise.resolve(); + update_promise.then(flush); } } diff --git a/test/runtime/samples/lifecycle-next-tick/_config.js b/test/runtime/samples/lifecycle-next-tick/_config.js index 9ecd589d64..35a66f7a09 100644 --- a/test/runtime/samples/lifecycle-next-tick/_config.js +++ b/test/runtime/samples/lifecycle-next-tick/_config.js @@ -3,13 +3,13 @@ export default { const buttons = target.querySelectorAll('button'); const click = new window.MouseEvent('click'); - await (await buttons[0].dispatchEvent(click)); + await buttons[0].dispatchEvent(click); assert.deepEqual(component.snapshots, [ 'before 0', 'after 1' ]); - await (await buttons[0].dispatchEvent(click)); + await buttons[0].dispatchEvent(click); assert.deepEqual(component.snapshots, [ 'before 0', 'after 1', @@ -17,7 +17,7 @@ export default { 'after 2' ]); - await (await buttons[1].dispatchEvent(click)); + await buttons[1].dispatchEvent(click); assert.deepEqual(component.snapshots, [ 'before 0', 'after 1',