File tree Expand file tree Collapse file tree 4 files changed +10
-10
lines changed
tests/runtime-runes/samples/async-resolve-stale Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ import { get_boundary } from './boundary.js';
2020export function async ( node , expressions , fn ) {
2121 var boundary = get_boundary ( ) ;
2222 var batch = /** @type {Batch } */ ( current_batch ) ;
23-
2423 var blocking = ! boundary . is_pending ( ) ;
2524
2625 boundary . update_pending_count ( 1 ) ;
Original file line number Diff line number Diff line change 11/** @import { Effect, TemplateNode, Value } from '#client' */
2- import { DESTROYED , STALE_REACTION } from '#client/constants' ;
2+ import { DESTROYED } from '#client/constants' ;
33import { DEV } from 'esm-env' ;
44import {
55 component_context ,
@@ -218,7 +218,6 @@ export function unset_context() {
218218export async function async_body ( anchor , fn ) {
219219 var boundary = get_boundary ( ) ;
220220 var batch = /** @type {Batch } */ ( current_batch ) ;
221-
222221 var blocking = ! boundary . is_pending ( ) ;
223222
224223 boundary . update_pending_count ( 1 ) ;
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ export default test({
2121 input . dispatchEvent ( new Event ( 'input' , { bubbles : true } ) ) ;
2222 await sleep ( ) ;
2323 assert . htmlEqual ( target . innerHTML , '<input> 3 | 12' ) ;
24+
2425 input . value = '' ;
2526 input . dispatchEvent ( new Event ( 'input' , { bubbles : true } ) ) ;
2627 await sleep ( ) ;
Original file line number Diff line number Diff line change 44
55 let resolver;
66
7- function asd (v ) {
7+ function asd (v ) {
88 let r = Promise .withResolvers ();
99
10- function update_and_resolve (){
10+ function update_and_resolve () {
1111 count++ ;
1212 r .resolve (v);
1313 }
1414
1515 // make sure the second promise resolve before the first one
16- if (resolver){
16+ if (resolver){
1717 new Promise (r => {
1818 setTimeout (r);
19- }).then (update_and_resolve).then (()=> {
20- setTimeout (()=> {
19+ }).then (update_and_resolve).then (() => {
20+ setTimeout (() => {
2121 resolver ();
2222 resolver = null ;
2323 });
2424 });
25- }else if (v){
25+ } else if (v) {
2626 resolver = update_and_resolve;
27- }else {
27+ } else {
2828 Promise .resolve ().then (update_and_resolve);
2929 }
30+
3031 return r .promise ;
3132 }
3233
You can’t perform that action at this time.
0 commit comments