deconflict `block` var used in dev mode (#3854)

pull/3856/head
Conduitry 5 years ago
parent 601ec45780
commit 153debb6fa

@ -376,6 +376,8 @@ export default class Block {
d: ${properties.destroy} d: ${properties.destroy}
}`; }`;
const block = dev && this.get_unique_name('block');
const body = b` const body = b`
${Array.from(this.variables.values()).map(({ id, init }) => { ${Array.from(this.variables.values()).map(({ id, init }) => {
return init return init
@ -387,9 +389,15 @@ export default class Block {
${dev ${dev
? b` ? b`
const block = ${return_value}; const ${block} = ${return_value};
@dispatch_dev("SvelteRegisterBlock", { block, id: ${this.name || 'create_fragment'}.name, type: "${this.type}", source: "${this.comment ? this.comment.replace(/"/g, '\\"') : ''}", ctx: #ctx }); @dispatch_dev("SvelteRegisterBlock", {
return block;` block: ${block},
id: ${this.name || 'create_fragment'}.name,
type: "${this.type}",
source: "${this.comment ? this.comment.replace(/"/g, '\\"') : ''}",
ctx: #ctx
});
return ${block};`
: b` : b`
return ${return_value};` return ${return_value};`
} }

Loading…
Cancel
Save