From e8b0f31da67d1994245832376773b340634b5c58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Wed, 22 Dec 2021 11:33:12 +0100 Subject: [PATCH] [IMP] compiler: improve generated compiled code --- src/compiler/code_generator.ts | 23 ++- tests/__snapshots__/reactivity.test.ts.snap | 52 ++--- tests/app/__snapshots__/app.test.ts.snap | 10 +- .../__snapshots__/attributes.test.ts.snap | 178 +++++++++--------- .../__snapshots__/event_handling.test.ts.snap | 134 ++++++------- .../compiler/__snapshots__/misc.test.ts.snap | 116 ++++++------ .../simple_templates.test.ts.snap | 34 ++-- .../__snapshots__/t_call.test.ts.snap | 54 +++--- .../compiler/__snapshots__/t_esc.test.ts.snap | 48 ++--- .../__snapshots__/t_foreach.test.ts.snap | 50 ++--- .../compiler/__snapshots__/t_if.test.ts.snap | 8 +- .../compiler/__snapshots__/t_key.test.ts.snap | 16 +- .../compiler/__snapshots__/t_ref.test.ts.snap | 10 +- .../compiler/__snapshots__/t_set.test.ts.snap | 118 ++++++------ .../__snapshots__/basics.test.ts.snap | 62 +++--- .../__snapshots__/concurrency.test.ts.snap | 160 ++++++++-------- .../__snapshots__/error_handling.test.ts.snap | 56 +++--- .../__snapshots__/event_handling.test.ts.snap | 20 +- .../higher_order_component.test.ts.snap | 10 +- .../__snapshots__/hooks.test.ts.snap | 42 ++--- .../__snapshots__/lifecycle.test.ts.snap | 34 ++-- .../__snapshots__/props.test.ts.snap | 32 ++-- .../props_validation.test.ts.snap | 20 +- .../__snapshots__/reactivity.test.ts.snap | 18 +- .../__snapshots__/refs.test.ts.snap | 8 +- .../__snapshots__/slots.test.ts.snap | 118 ++++++------ .../__snapshots__/style_class.test.ts.snap | 66 +++---- .../__snapshots__/t_call.test.ts.snap | 28 +-- .../__snapshots__/t_component.test.ts.snap | 6 +- .../__snapshots__/t_foreach.test.ts.snap | 34 ++-- .../__snapshots__/t_key.test.ts.snap | 24 +-- .../__snapshots__/t_model.test.ts.snap | 164 ++++++++-------- .../__snapshots__/t_on.test.ts.snap | 32 ++-- .../__snapshots__/t_props.test.ts.snap | 14 +- .../__snapshots__/t_set.test.ts.snap | 44 ++--- tests/misc/__snapshots__/portal.test.ts.snap | 32 ++-- 36 files changed, 939 insertions(+), 936 deletions(-) diff --git a/src/compiler/code_generator.ts b/src/compiler/code_generator.ts index 49ec62de..548b989b 100644 --- a/src/compiler/code_generator.ts +++ b/src/compiler/code_generator.ts @@ -69,8 +69,8 @@ class BlockDescription { this.type = type; } - insertData(str: string): number { - const id = "d" + BlockDescription.nextDataId++; + insertData(str: string, prefix: string = "d"): number { + const id = prefix + BlockDescription.nextDataId++; this.target.addLine(`let ${id} = ${str};`); return this.data.push(id) - 1; } @@ -515,11 +515,11 @@ export class CodeGenerator { for (let key in ast.attrs) { if (key.startsWith("t-attf")) { let expr = interpolate(ast.attrs[key]); - const idx = block!.insertData(expr); + const idx = block!.insertData(expr, "attr"); attrs["block-attribute-" + idx] = key.slice(7); } else if (key.startsWith("t-att")) { let expr = compileExpr(ast.attrs[key]); - const idx = block!.insertData(expr); + const idx = block!.insertData(expr, "attr"); if (key === "t-att") { attrs[`block-attributes`] = String(idx); } else { @@ -535,7 +535,7 @@ export class CodeGenerator { // event handlers for (let ev in ast.on) { const name = this.generateHandlerCode(ev, ast.on[ev]); - const idx = block!.insertData(name); + const idx = block!.insertData(name, "hdlr"); attrs[`block-handler-${idx}`] = ev; } @@ -548,7 +548,7 @@ export class CodeGenerator { INTERP_REGEXP, (expr) => "${" + this.captureExpression(expr.slice(2, -2), true) + "}" ); - const idx = block!.insertData(`(el) => refs[\`${str}\`] = el`); + const idx = block!.insertData(`(el) => refs[\`${str}\`] = el`, "ref"); attrs["block-ref"] = String(idx); } else { const idx = block!.insertData(`(el) => refs[\`${ast.ref}\`] = el`); @@ -576,10 +576,13 @@ export class CodeGenerator { let idx: number; if (specialInitTargetAttr) { - idx = block!.insertData(`${baseExpression}[${expression}] === '${attrs[targetAttr]}'`); + idx = block!.insertData( + `${baseExpression}[${expression}] === '${attrs[targetAttr]}'`, + "attr" + ); attrs[`block-attribute-${idx}`] = specialInitTargetAttr; } else { - idx = block!.insertData(`${baseExpression}[${expression}]`); + idx = block!.insertData(`${baseExpression}[${expression}]`, "attr"); attrs[`block-attribute-${idx}`] = targetAttr; } this.helpers.add("toNumber"); @@ -588,7 +591,7 @@ export class CodeGenerator { valueCode = shouldNumberize ? `toNumber(${valueCode})` : valueCode; const handler = `[(ev) => { bExpr${id}[${expression}] = ${valueCode}; }]`; - idx = block!.insertData(handler); + idx = block!.insertData(handler, "hdlr"); attrs[`block-handler-${idx}`] = eventType; } @@ -652,7 +655,7 @@ export class CodeGenerator { block = this.createBlock(block, "text", ctx); this.insertBlock(`text(${expr})`, block, { ...ctx, forceNewBlock: forceNewBlock && !block }); } else { - const idx = block.insertData(expr); + const idx = block.insertData(expr, "txt"); const text = xmlDoc.createElement(`block-text-${idx}`); block.insert(text); } diff --git a/tests/__snapshots__/reactivity.test.ts.snap b/tests/__snapshots__/reactivity.test.ts.snap index e2c36b4a..112efe77 100644 --- a/tests/__snapshots__/reactivity.test.ts.snap +++ b/tests/__snapshots__/reactivity.test.ts.snap @@ -71,8 +71,8 @@ exports[`Reactivity: useState destroyed component before being mounted is inacti let block1 = createBlock(\`\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['contextObj'].a; - return block1([d1]); + let txt1 = ctx['contextObj'].a; + return block1([txt1]); } }" `; @@ -102,8 +102,8 @@ exports[`Reactivity: useState destroyed component is inactive 2`] = ` let block1 = createBlock(\`\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['contextObj'].a; - return block1([d1]); + let txt1 = ctx['contextObj'].a; + return block1([txt1]); } }" `; @@ -116,9 +116,9 @@ exports[`Reactivity: useState one components can subscribe twice to same context let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['contextObj1'].a; - let d2 = ctx['contextObj2'].b; - return block1([d1, d2]); + let txt1 = ctx['contextObj1'].a; + let txt2 = ctx['contextObj2'].b; + return block1([txt1, txt2]); } }" `; @@ -132,8 +132,8 @@ exports[`Reactivity: useState parent and children subscribed to same context 1`] return function template(ctx, node, key = \\"\\") { let b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx); - let d1 = ctx['contextObj'].b; - return block1([d1], [b2]); + let txt1 = ctx['contextObj'].b; + return block1([txt1], [b2]); } }" `; @@ -146,8 +146,8 @@ exports[`Reactivity: useState parent and children subscribed to same context 2`] let block1 = createBlock(\`\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['contextObj'].a; - return block1([d1]); + let txt1 = ctx['contextObj'].a; + return block1([txt1]); } }" `; @@ -238,8 +238,8 @@ exports[`Reactivity: useState two components are updated in parallel 2`] = ` let block1 = createBlock(\`\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['contextObj'].value; - return block1([d1]); + let txt1 = ctx['contextObj'].value; + return block1([txt1]); } }" `; @@ -267,8 +267,8 @@ exports[`Reactivity: useState two components can subscribe to same context 2`] = let block1 = createBlock(\`\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['contextObj'].value; - return block1([d1]); + let txt1 = ctx['contextObj'].value; + return block1([txt1]); } }" `; @@ -296,8 +296,8 @@ exports[`Reactivity: useState two independent components on different levels are let block1 = createBlock(\`\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['contextObj'].value; - return block1([d1]); + let txt1 = ctx['contextObj'].value; + return block1([txt1]); } }" `; @@ -324,8 +324,8 @@ exports[`Reactivity: useState useContext=useState hook is reactive, for one comp let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['contextObj'].value; - return block1([d1]); + let txt1 = ctx['contextObj'].value; + return block1([txt1]); } }" `; @@ -348,9 +348,9 @@ exports[`Reactivity: useState useless atoms should be deleted 1`] = ` } ctx = ctx.__proto__; let b2 = list(c_block2); - let d1 = ctx['total']; - let d2 = Object.keys(ctx['state']).length; - return block1([d1, d2], [b2]); + let txt1 = ctx['total']; + let txt2 = Object.keys(ctx['state']).length; + return block1([txt1, txt2], [b2]); } }" `; @@ -363,8 +363,8 @@ exports[`Reactivity: useState useless atoms should be deleted 2`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['state'].quantity; - return block1([d1]); + let txt1 = ctx['state'].quantity; + return block1([txt1]); } }" `; @@ -377,8 +377,8 @@ exports[`Reactivity: useState very simple use, with initial value 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['contextObj'].value; - return block1([d1]); + let txt1 = ctx['contextObj'].value; + return block1([txt1]); } }" `; diff --git a/tests/app/__snapshots__/app.test.ts.snap b/tests/app/__snapshots__/app.test.ts.snap index aa92154d..eb49badc 100644 --- a/tests/app/__snapshots__/app.test.ts.snap +++ b/tests/app/__snapshots__/app.test.ts.snap @@ -8,9 +8,9 @@ exports[`app App supports env with getters/setters 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['env'].someVal; - let d2 = Object.keys(ctx['env'].services); - return block1([d1, d2]); + let txt1 = ctx['env'].someVal; + let txt2 = Object.keys(ctx['env'].services); + return block1([txt1, txt2]); } }" `; @@ -23,8 +23,8 @@ exports[`app can configure an app with props 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['props'].value; - return block1([d1]); + let txt1 = ctx['props'].value; + return block1([txt1]); } }" `; diff --git a/tests/compiler/__snapshots__/attributes.test.ts.snap b/tests/compiler/__snapshots__/attributes.test.ts.snap index 755d3d6f..f45678ad 100644 --- a/tests/compiler/__snapshots__/attributes.test.ts.snap +++ b/tests/compiler/__snapshots__/attributes.test.ts.snap @@ -8,8 +8,8 @@ exports[`attributes changing a class with t-att-class (preexisting class 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['v']; - return block1([d1]); + let attr1 = ctx['v']; + return block1([attr1]); } }" `; @@ -22,8 +22,8 @@ exports[`attributes changing a class with t-att-class 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['v']; - return block1([d1]); + let attr1 = ctx['v']; + return block1([attr1]); } }" `; @@ -36,8 +36,8 @@ exports[`attributes changing an attribute with t-att- 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['v']; - return block1([d1]); + let attr1 = ctx['v']; + return block1([attr1]); } }" `; @@ -50,8 +50,8 @@ exports[`attributes class and t-att-class should combine together 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['value']; - return block1([d1]); + let attr1 = ctx['value']; + return block1([attr1]); } }" `; @@ -64,8 +64,8 @@ exports[`attributes class and t-attf-class with ternary operation 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = (ctx['value']?'world':''); - return block1([d1]); + let attr1 = (ctx['value']?'world':''); + return block1([attr1]); } }" `; @@ -78,8 +78,8 @@ exports[`attributes dynamic attribute evaluating to 0 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['value']; - return block1([d1]); + let attr1 = ctx['value']; + return block1([attr1]); } }" `; @@ -92,8 +92,8 @@ exports[`attributes dynamic attribute falsy variable 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['value']; - return block1([d1]); + let attr1 = ctx['value']; + return block1([attr1]); } }" `; @@ -106,8 +106,8 @@ exports[`attributes dynamic attribute with a dash 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['id']; - return block1([d1]); + let attr1 = ctx['id']; + return block1([attr1]); } }" `; @@ -120,8 +120,8 @@ exports[`attributes dynamic attributes 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = 'bar'; - return block1([d1]); + let attr1 = 'bar'; + return block1([attr1]); } }" `; @@ -134,8 +134,8 @@ exports[`attributes dynamic class attribute 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['c']; - return block1([d1]); + let attr1 = ctx['c']; + return block1([attr1]); } }" `; @@ -148,8 +148,8 @@ exports[`attributes dynamic class attribute evaluating to 0 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['value']; - return block1([d1]); + let attr1 = ctx['value']; + return block1([attr1]); } }" `; @@ -162,8 +162,8 @@ exports[`attributes dynamic empty class attribute 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['c']; - return block1([d1]); + let attr1 = ctx['c']; + return block1([attr1]); } }" `; @@ -176,8 +176,8 @@ exports[`attributes dynamic formatted attributes with a dash 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = \`Some text \${ctx['id']}\`; - return block1([d1]); + let attr1 = \`Some text \${ctx['id']}\`; + return block1([attr1]); } }" `; @@ -190,8 +190,8 @@ exports[`attributes dynamic undefined class attribute 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['c']; - return block1([d1]); + let attr1 = ctx['c']; + return block1([attr1]); } }" `; @@ -204,8 +204,8 @@ exports[`attributes dynamic undefined generic attribute 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['c']; - return block1([d1]); + let attr1 = ctx['c']; + return block1([attr1]); } }" `; @@ -218,8 +218,8 @@ exports[`attributes fixed variable 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['value']; - return block1([d1]); + let attr1 = ctx['value']; + return block1([attr1]); } }" `; @@ -232,8 +232,8 @@ exports[`attributes format expression 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = (ctx['value']+37); - return block1([d1]); + let attr1 = (ctx['value']+37); + return block1([attr1]); } }" `; @@ -246,8 +246,8 @@ exports[`attributes format literal 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = \`bar\`; - return block1([d1]); + let attr1 = \`bar\`; + return block1([attr1]); } }" `; @@ -260,8 +260,8 @@ exports[`attributes format multiple 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = \`a \${ctx['value1']} is \${ctx['value2']} of \${ctx['value3']} ]\`; - return block1([d1]); + let attr1 = \`a \${ctx['value1']} is \${ctx['value2']} of \${ctx['value3']} ]\`; + return block1([attr1]); } }" `; @@ -274,8 +274,8 @@ exports[`attributes format value 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = \`b\${ctx['value']}r\`; - return block1([d1]); + let attr1 = \`b\${ctx['value']}r\`; + return block1([attr1]); } }" `; @@ -292,8 +292,8 @@ exports[`attributes from object variables set previously 1`] = ` ctx = Object.create(ctx); ctx[isBoundary] = 1 setContextValue(ctx, \\"o\\", {a:'b'}); - let d1 = ctx['o'].a; - return block1([d1]); + let attr1 = ctx['o'].a; + return block1([attr1]); } }" `; @@ -310,8 +310,8 @@ exports[`attributes from variables set previously (no external node) 1`] = ` ctx = Object.create(ctx); ctx[isBoundary] = 1 setContextValue(ctx, \\"abc\\", 'def'); - let d1 = ctx['abc']; - return block1([d1]); + let attr1 = ctx['abc']; + return block1([attr1]); } }" `; @@ -328,8 +328,8 @@ exports[`attributes from variables set previously 1`] = ` ctx = Object.create(ctx); ctx[isBoundary] = 1 setContextValue(ctx, \\"abc\\", 'def'); - let d1 = ctx['abc']; - return block1([d1]); + let attr1 = ctx['abc']; + return block1([attr1]); } }" `; @@ -342,8 +342,8 @@ exports[`attributes object 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['value']; - return block1([d1]); + let attr1 = ctx['value']; + return block1([attr1]); } }" `; @@ -395,8 +395,8 @@ exports[`attributes t-att-class and class should combine together 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['value']; - return block1([d1]); + let attr1 = ctx['value']; + return block1([attr1]); } }" `; @@ -409,8 +409,8 @@ exports[`attributes t-att-class with multiple classes 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = {'a b c':ctx['value']}; - return block1([d1]); + let attr1 = {'a b c':ctx['value']}; + return block1([attr1]); } }" `; @@ -423,8 +423,8 @@ exports[`attributes t-att-class with multiple classes 2`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = {['a b c']:ctx['value']}; - return block1([d1]); + let attr1 = {['a b c']:ctx['value']}; + return block1([attr1]); } }" `; @@ -437,8 +437,8 @@ exports[`attributes t-att-class with multiple classes, some of which are duplica let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = {'a b c':ctx['value'],'a b d':!ctx['value']}; - return block1([d1]); + let attr1 = {'a b c':ctx['value'],'a b d':!ctx['value']}; + return block1([attr1]); } }" `; @@ -451,8 +451,8 @@ exports[`attributes t-att-class with object 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = {a:ctx['b'],c:ctx['d'],e:ctx['f']}; - return block1([d1]); + let attr1 = {a:ctx['b'],c:ctx['d'],e:ctx['f']}; + return block1([attr1]); } }" `; @@ -465,8 +465,8 @@ exports[`attributes t-attf-class 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = \`hello\`; - return block1([d1]); + let attr1 = \`hello\`; + return block1([attr1]); } }" `; @@ -479,8 +479,8 @@ exports[`attributes t-attf-class should combine with class 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = \`world\`; - return block1([d1]); + let attr1 = \`world\`; + return block1([attr1]); } }" `; @@ -493,8 +493,8 @@ exports[`attributes t-attf-class with multiple classes 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = \`hello \${ctx['word']}\`; - return block1([d1]); + let attr1 = \`hello \${ctx['word']}\`; + return block1([attr1]); } }" `; @@ -507,8 +507,8 @@ exports[`attributes t-attf-class with multiple classes separated by multiple spa let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = \`hello \${ctx['word']}\`; - return block1([d1]); + let attr1 = \`hello \${ctx['word']}\`; + return block1([attr1]); } }" `; @@ -521,8 +521,8 @@ exports[`attributes tuple literal 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ['foo','bar']; - return block1([d1]); + let attr1 = ['foo','bar']; + return block1([attr1]); } }" `; @@ -535,8 +535,8 @@ exports[`attributes tuple variable 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['value']; - return block1([d1]); + let attr1 = ctx['value']; + return block1([attr1]); } }" `; @@ -562,9 +562,9 @@ exports[`attributes two dynamic attributes 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = 'bar'; - let d2 = 'foo'; - return block1([d1, d2]); + let attr1 = 'bar'; + let attr2 = 'foo'; + return block1([attr1, attr2]); } }" `; @@ -577,8 +577,8 @@ exports[`attributes updating classes (with obj notation) 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = {'a b':ctx['condition']}; - return block1([d1]); + let attr1 = {'a b':ctx['condition']}; + return block1([attr1]); } }" `; @@ -591,10 +591,10 @@ exports[`attributes various escapes 1`] = ` let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['bar']; - let d2 = \`<\${ctx['baz']}>\`; - let d3 = ctx['qux']; - return block1([d1, d2, d3]); + let attr1 = ctx['bar']; + let attr2 = \`<\${ctx['baz']}>\`; + let attr3 = ctx['qux']; + return block1([attr1, attr2, attr3]); } }" `; @@ -620,8 +620,8 @@ exports[`special cases for some specific html attributes/properties input of typ let block1 = createBlock(\`\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['v']; - return block1([d1]); + let attr1 = ctx['v']; + return block1([attr1]); } }" `; @@ -634,8 +634,8 @@ exports[`special cases for some specific html attributes/properties input type= let block1 = createBlock(\`\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['flag']; - return block1([d1]); + let attr1 = ctx['flag']; + return block1([attr1]); } }" `; @@ -648,8 +648,8 @@ exports[`special cases for some specific html attributes/properties input with t let block1 = createBlock(\`\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['v']; - return block1([d1]); + let attr1 = ctx['v']; + return block1([attr1]); } }" `; @@ -662,8 +662,8 @@ exports[`special cases for some specific html attributes/properties select with let block1 = createBlock(\`\`); return function template(ctx, node, key = \\"\\") { - let d1 = ctx['value']; - return block1([d1]); + let attr1 = ctx['value']; + return block1([attr1]); } }" `; @@ -676,8 +676,8 @@ exports[`special cases for some specific html attributes/properties textarea wit let block1 = createBlock(\`