Skip to content

Commit

Permalink
Merge 274148d into 910ab1d
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Jan 15, 2019
2 parents 910ab1d + 274148d commit 95e8db4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
6 changes: 5 additions & 1 deletion src/compiler/ast/Scriptlet.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ class Scriptlet extends Node {
return;
}

if (typeof code === "string") {
if (typeof code === "string" && this.block) {
code = adjustIndent(code, writer.currentIndent);
}

writer.write(code);
writer.write("\n");
}

walk(walker) {
this.code = walker.walk(this.code);
}
}

module.exports = Scriptlet;
4 changes: 4 additions & 0 deletions src/compiler/ast/TemplateLiteral.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ class TemplateLiteral extends Node {
writer.write(quote + code + quote);
writer.write("\n");
}

walk(walker) {
this.expressions = walker.walk(this.expressions);
}
}

function escapeQuasi(quasi, quote) {
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/ast/Vars.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Vars extends Node {
}

walk(walker) {
this.argument = walker.walk(this.argument);
this.declarations = walker.walk(this.declarations);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions test/vdom-compiler/fixtures/attrs-dynamic/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ function render(input, out, __component, component, state) {
var data = input;

var attrs = {
foo: "bar",
hello: "world"
}
foo: "bar",
hello: "world"
}

out.e("DIV", marko_attrs(attrs), null, null, 3)
.t("Hello ")
Expand All @@ -30,4 +30,4 @@ marko_template._ = marko_renderer(render, {
___type: marko_componentType
});

marko_template.Component = marko_defineComponent({}, marko_template._);
marko_template.Component = marko_defineComponent({}, marko_template._);

0 comments on commit 95e8db4

Please sign in to comment.