File tree Expand file tree Collapse file tree 2 files changed +5
-12
lines changed
packages/svelte/src/compiler
phases/3-transform/client/visitors Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ export function IfBlock(node, context) {
2121
2222 if ( node . alternate ) {
2323 const alternate = /** @type {BlockStatement } */ ( context . visit ( node . alternate ) ) ;
24- alternate_id = context . state . scope . generate ( 'alternate' ) ;
25- statements . push ( b . var ( b . id ( alternate_id ) , b . arrow ( [ b . id ( '$$anchor' ) ] , alternate ) ) ) ;
24+ alternate_id = b . id ( context . state . scope . generate ( 'alternate' ) ) ;
25+ statements . push ( b . var ( alternate_id , b . arrow ( [ b . id ( '$$anchor' ) ] , alternate ) ) ) ;
2626 }
2727
2828 const { has_await } = node . metadata . expression ;
@@ -38,15 +38,8 @@ export function IfBlock(node, context) {
3838 b . if (
3939 test ,
4040 b . stmt ( b . call ( b . id ( '$$render' ) , b . id ( consequent_id ) ) ) ,
41- alternate_id
42- ? b . stmt (
43- b . call (
44- b . id ( '$$render' ) ,
45- b . id ( alternate_id ) ,
46- node . alternate ? b . literal ( false ) : undefined
47- )
48- )
49- : undefined
41+ alternate_id &&
42+ b . stmt ( b . call ( '$$render' , alternate_id , node . alternate && b . literal ( false ) ) )
5043 )
5144 ] )
5245 )
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ export function labeled(name, body) {
101101
102102/**
103103 * @param {string | ESTree.Expression } callee
104- * @param {...(ESTree.Expression | ESTree.SpreadElement | false | undefined) } args
104+ * @param {...(ESTree.Expression | ESTree.SpreadElement | false | undefined | null ) } args
105105 * @returns {ESTree.CallExpression }
106106 */
107107export function call ( callee , ...args ) {
You can’t perform that action at this time.
0 commit comments