fix code-red usage

pull/4385/head
Conduitry 6 years ago
parent 28c1898297
commit 033dc8a169

@ -197,7 +197,7 @@ export default class Renderer {
return filtered
.map(n => x`$$invalidate(${this.context_lookup.get(n).index}, ${n})`)
.reduce((lhs, rhs) => x`${lhs}, ${rhs}}`);
.reduce((lhs, rhs) => x`${lhs}, ${rhs}`);
}
dirty(names, is_reactive_declaration = false): Expression {

@ -403,9 +403,9 @@ export default function dom(
${set && b`$$self.$set = ${set};`}
${capture_state && x`$$self.$capture_state = ${capture_state};`}
${capture_state && b`$$self.$capture_state = ${capture_state};`}
${inject_state && x`$$self.$inject_state = ${inject_state};`}
${inject_state && b`$$self.$inject_state = ${inject_state};`}
${injected.map(name => b`let ${name};`)}

@ -67,7 +67,7 @@ export function invalidate(renderer: Renderer, scope: Scope, node: Node, names:
if (head.subscribable && head.reassigned) {
const subscribe = `$$subscribe_${head.name}`;
invalidate = x`${subscribe}(${invalidate})}`;
invalidate = x`${subscribe}(${invalidate})`;
}
return invalidate;

@ -205,7 +205,7 @@ export default class AwaitBlockWrapper extends Wrapper {
} else {
const #child_ctx = #ctx.slice();
${this.node.value && x`#child_ctx[${value_index}] = ${info}.resolved;`}
${this.node.value && b`#child_ctx[${value_index}] = ${info}.resolved;`}
${info}.block.p(#child_ctx, #dirty);
}
`);
@ -219,7 +219,7 @@ export default class AwaitBlockWrapper extends Wrapper {
block.chunks.update.push(b`
{
const #child_ctx = #ctx.slice();
${this.node.value && x`#child_ctx[${value_index}] = ${info}.resolved;`}
${this.node.value && b`#child_ctx[${value_index}] = ${info}.resolved;`}
${info}.block.p(#child_ctx, #dirty);
}
`);

@ -97,7 +97,7 @@ export default class BindingWrapper {
const type = parent.node.get_static_attribute_value('type');
if (type === null || type === "" || type === "text" || type === "email" || type === "password") {
update_conditions.push(x`(${parent.var}.${this.node.name} !== ${this.snippet})`);
update_conditions.push(x`${parent.var}.${this.node.name} !== ${this.snippet}`);
}
}

@ -415,7 +415,7 @@ export default class ElementWrapper extends Wrapper {
const is = this.attributes.find(attr => attr.node.name === 'is');
if (is) {
return x`@element_is("${name}", ${is.render_chunks(block).reduce((lhs, rhs) => x`${lhs} + ${rhs}`)});`;
return x`@element_is("${name}", ${is.render_chunks(block).reduce((lhs, rhs) => x`${lhs} + ${rhs}`)})`;
}
return x`@element("${name}")`;

@ -17,7 +17,7 @@ export default class MustacheTagWrapper extends Tag {
render(block: Block, parent_node: Identifier, parent_nodes: Identifier) {
const { init } = this.rename_this_method(
block,
value => x`@set_data(${this.var}, ${value});`
value => x`@set_data(${this.var}, ${value})`
);
block.add_element(

@ -48,7 +48,7 @@ export default class RawMustacheTagWrapper extends Tag {
const { init } = this.rename_this_method(
block,
content => x`${html_tag}.p(${content});`
content => x`${html_tag}.p(${content})`
);
const update_anchor = in_head ? 'null' : needs_anchor ? html_anchor : this.next ? this.next.var : 'null';

@ -12,9 +12,9 @@ export default function(node: AwaitBlock, renderer: Renderer, options: RenderOpt
const then = renderer.pop();
renderer.add_expression(x`
(function(__value) {
function(__value) {
if (@is_promise(__value)) return ${pending};
return (function(${node.value}) { return ${then}; }(__value));
}(${node.expression.node}))
}(${node.expression.node})
`);
}

@ -65,7 +65,7 @@ export default function(node: Element, renderer: Renderer, options: RenderOption
}
});
renderer.add_expression(x`@spread([${args}], ${class_expression});`);
renderer.add_expression(x`@spread([${args}], ${class_expression})`);
} else {
let add_class_attribute = !!class_expression;
node.attributes.forEach(attribute => {

@ -12,5 +12,5 @@ export default function(node: Head, renderer: Renderer, options: RenderOptions)
renderer.render(node.children, head_options);
const result = renderer.pop();
renderer.add_expression(x`($$result.head += ${result}, "")`);
renderer.add_expression(x`$$result.head += ${result}, ""`);
}

@ -12,5 +12,5 @@ export default function(node: Title, renderer: Renderer, options: RenderOptions)
renderer.add_string(`</title>`);
const result = renderer.pop();
renderer.add_expression(x`($$result.title = ${result}, "")`);
renderer.add_expression(x`$$result.title = ${result}, ""`);
}

Loading…
Cancel
Save