diff --git a/test/fixtures/codegen/autotest/templateRoot-prependChild/expected.js b/test/fixtures/codegen/autotest/templateRoot-prependChild/expected.js new file mode 100644 index 000000000..68356d67b --- /dev/null +++ b/test/fixtures/codegen/autotest/templateRoot-prependChild/expected.js @@ -0,0 +1,24 @@ +function create(__helpers) { + var str = __helpers.s, + empty = __helpers.e, + notEmpty = __helpers.ne, + escapeXml = __helpers.x; + + return function render(data, out) { + out.w(""); + }; +} + +(module.exports = require("marko").c(__filename)).c(create); diff --git a/test/fixtures/codegen/autotest/templateRoot-prependChild/index.js b/test/fixtures/codegen/autotest/templateRoot-prependChild/index.js new file mode 100644 index 000000000..cb9dcfb8b --- /dev/null +++ b/test/fixtures/codegen/autotest/templateRoot-prependChild/index.js @@ -0,0 +1,20 @@ +'use strict'; + +module.exports = function(builder) { + var templateRoot = builder.templateRoot([ + builder.htmlElement( + 'div', + []) + ]); + + templateRoot.prependChild(builder.vars([ + { + id: 'foo', + init: builder.literal('bar') + } + ])); + + console.log(templateRoot.body.items); + + return templateRoot; +}; \ No newline at end of file