@@ -22,8 +22,7 @@ exports[`t-on can bind handlers with arguments 1`] = `
2222 let block1 = createBlock (\` <button block-handler-0 = " click" >Click</button >\` );
2323
2424 return function template(ctx, node, key = "") {
25- const v1 = ctx [' add' ];
26- let hdlr1 = [()=> v1 (5 ), ctx ];
25+ let hdlr1 = [()=> ctx [' add' ](5 ), ctx ];
2726 return block1 ([hdlr1 ]);
2827 }
2928}"
@@ -37,8 +36,7 @@ exports[`t-on can bind handlers with empty object 1`] = `
3736 let block1 = createBlock (\` <button block-handler-0 = " click" >Click</button >\` );
3837
3938 return function template(ctx, node, key = "") {
40- const v1 = ctx [' doSomething' ];
41- let hdlr1 = [()=> v1 ({}), ctx ];
39+ let hdlr1 = [()=> ctx [' doSomething' ]({}), ctx ];
4240 return block1 ([hdlr1 ]);
4341 }
4442}"
@@ -52,8 +50,7 @@ exports[`t-on can bind handlers with empty object (with non empty inner string)
5250 let block1 = createBlock (\` <button block-handler-0 = " click" >Click</button >\` );
5351
5452 return function template(ctx, node, key = "") {
55- const v1 = ctx [' doSomething' ];
56- let hdlr1 = [()=> v1 ({}), ctx ];
53+ let hdlr1 = [()=> ctx [' doSomething' ]({}), ctx ];
5754 return block1 ([hdlr1 ]);
5855 }
5956}"
@@ -69,15 +66,14 @@ exports[`t-on can bind handlers with empty object (with non empty inner string)
6966 let block3 = createBlock(\` <li ><a block-handler-0 = " click" >link</a ></li >\` );
7067
7168 return function template(ctx, node, key = "") {
72- ctx = Object . create ( ctx ) ;
69+ const ctx1 = ctx ;
7370 const [k_block2 , v_block2 , l_block2 , c_block2 ] = prepareList ([' someval' ]);;
7471 for (let i1 = 0 ; i1 < l_block2 ; i1 ++ ) {
72+ const ctx = Object.create(ctx1 );
7573 ctx[\`action\`] = k_block2[i1];
7674 ctx[\`action_index\`] = i1;
7775 const key1 = ctx['action_index'];
78- const v1 = ctx['activate'];
79- const v2 = ctx['action'];
80- let hdlr1 = [()=>v1(v2 ), ctx];
76+ let hdlr1 = [()=>ctx[' activate' ](ctx ['action ']), ctx];
8177 c_block2[i1] = withKey(block3 ([hdlr1 ]), key1);
8278 }
8379 const b2 = list (c_block2 );
@@ -94,8 +90,7 @@ exports[`t-on can bind handlers with object arguments 1`] = `
9490 let block1 = createBlock (\` <button block-handler-0 = " click" >Click</button >\` );
9591
9692 return function template(ctx, node, key = "") {
97- const v1 = ctx [' add' ];
98- let hdlr1 = [()=> v1 ({val:5 }), ctx ];
93+ let hdlr1 = [()=> ctx [' add' ]({val:5 }), ctx ];
9994 return block1 ([hdlr1 ]);
10095 }
10196}"
@@ -139,9 +134,10 @@ exports[`t-on handler is bound to proper owner, part 2 1`] = `
139134 let block2 = createBlock (\` <button block-handler-0 = " click" >Click</button >\` );
140135
141136 return function template(ctx, node, key = "") {
142- ctx = Object . create ( ctx ) ;
137+ const ctx1 = ctx ;
143138 const [k_block1 , v_block1 , l_block1 , c_block1 ] = prepareList ([1 ]);;
144139 for (let i1 = 0 ; i1 < l_block1 ; i1 ++ ) {
140+ const ctx = Object.create(ctx1 );
145141 ctx[\`value\`] = k_block1[i1];
146142 const key1 = ctx['value'];
147143 let hdlr1 = [ctx['add'], ctx];
@@ -186,9 +182,10 @@ exports[`t-on handler is bound to proper owner, part 4 1`] = `
186182 const callTemplate_1 = app .getTemplate (\` sub\` );
187183
188184 return function template(ctx, node, key = "") {
189- ctx = Object . create ( ctx ) ;
185+ const ctx1 = ctx ;
190186 const [k_block1 , v_block1 , l_block1 , c_block1 ] = prepareList ([1 ]);;
191187 for (let i1 = 0 ; i1 < l_block1 ; i1 ++ ) {
188+ const ctx = Object.create(ctx1 );
192189 ctx[\`value\`] = k_block1[i1];
193190 ctx[\`value_first\`] = i1 === 0;
194191 ctx[\`value_last\`] = i1 === k_block1.length - 1;
@@ -330,14 +327,13 @@ exports[`t-on t-on modifiers (native listener) t-on with prevent modifier in t-f
330327 let block3 = createBlock(\` <a href = " #" block-handler-0 = " click.prevent" > Edit <block-child-0 /></a >\` );
331328
332329 return function template(ctx, node, key = "") {
333- ctx = Object . create ( ctx ) ;
330+ const ctx1 = ctx ;
334331 const [k_block2 , v_block2 , l_block2 , c_block2 ] = prepareList (ctx [' projects' ]);;
335332 for (let i1 = 0 ; i1 < l_block2 ; i1 ++ ) {
333+ const ctx = Object.create(ctx1 );
336334 ctx[\`project\`] = k_block2[i1];
337335 const key1 = ctx['project'];
338- const v1 = ctx['onEdit'];
339- const v2 = ctx['project'];
340- let hdlr1 = ["prevent", _ev=>v1(v2 .id ,_ev ), ctx];
336+ let hdlr1 = ["prevent", _ev=>ctx[' onEdit' ](ctx ['project '].id ,_ev ), ctx];
341337 const b4 = safeOutput(ctx ['project '].name );
342338 c_block2[i1] = withKey(block3 ([hdlr1 ], [b4 ]), key1);
343339 }
@@ -399,8 +395,7 @@ exports[`t-on t-on with inline statement (function call) 1`] = `
399395 let block1 = createBlock (\` <button block-handler-0 = " click" >Click</button >\` );
400396
401397 return function template(ctx, node, key = "") {
402- const v1 = ctx [' state' ];
403- let hdlr1 = [()=> v1 .incrementCounter (2 ), ctx ];
398+ let hdlr1 = [()=> ctx [' state' ].incrementCounter (2 ), ctx ];
404399 return block1 ([hdlr1 ]);
405400 }
406401}"
@@ -414,8 +409,7 @@ exports[`t-on t-on with inline statement 1`] = `
414409 let block1 = createBlock (\` <button block-handler-0 = " click" >Click</button >\` );
415410
416411 return function template(ctx, node, key = "") {
417- const v1 = ctx [' state' ];
418- let hdlr1 = [()=> v1 .counter ++ , ctx ];
412+ let hdlr1 = [()=> ctx [' state' ].counter ++ , ctx ];
419413 return block1 ([hdlr1 ]);
420414 }
421415}"
@@ -429,8 +423,7 @@ exports[`t-on t-on with inline statement, part 2 1`] = `
429423 let block1 = createBlock (\` <button block-handler-0 = " click" >Toggle</button >\` );
430424
431425 return function template(ctx, node, key = "") {
432- const v1 = ctx [' state' ];
433- let hdlr1 = [()=> v1 .flag = ! v1 .flag , ctx ];
426+ let hdlr1 = [()=> ctx [' state' ].flag = ! ctx [' state' ].flag , ctx ];
434427 return block1 ([hdlr1 ]);
435428 }
436429}"
@@ -444,9 +437,7 @@ exports[`t-on t-on with inline statement, part 3 1`] = `
444437 let block1 = createBlock (\` <button block-handler-0 = " click" >Toggle</button >\` );
445438
446439 return function template(ctx, node, key = "") {
447- const v1 = ctx [' state' ];
448- const v2 = ctx [' someFunction' ];
449- let hdlr1 = [()=> v1 .n = v2 (3 ), ctx ];
440+ let hdlr1 = [()=> ctx [' state' ].n = ctx [' someFunction' ](3 ), ctx ];
450441 return block1 ([hdlr1 ]);
451442 }
452443}"
@@ -504,9 +495,7 @@ exports[`t-on t-on, with arguments and t-call 2`] = `
504495 let block1 = createBlock (\` <p block-handler-0 = " click" >lucas</p >\` );
505496
506497 return function template(ctx, node, key = "") {
507- const v1 = ctx [' this' ];
508- const v2 = ctx [' value' ];
509- let hdlr1 = [()=> v1 .update (v2 ), ctx ];
498+ let hdlr1 = [()=> ctx [' this' ].update (ctx [' value' ]), ctx ];
510499 return block1 ([hdlr1 ]);
511500 }
512501}"
0 commit comments