diff --git a/test/components-compilation/fixtures-html/arrow-functions/expected.js b/test/components-compilation/fixtures-html/arrow-functions/expected.js new file mode 100644 index 000000000..11ac2045b --- /dev/null +++ b/test/components-compilation/fixtures-html/arrow-functions/expected.js @@ -0,0 +1,45 @@ +"use strict"; + +var marko_template = module.exports = require("marko/src/html").t(__filename), + marko_component = { + onCreate: function() { + this.state = { + message: "didnt run it" + }; + + if (true) { + runIt(() => { + this.state.message = 'ran it'; + }); + } + } + }, + marko_componentType = "/marko-test$1.0.0/components-compilation/fixtures-html/arrow-functions/index.marko", + components_helpers = require("marko/src/components/helpers"), + marko_renderer = components_helpers.r, + marko_defineComponent = components_helpers.c, + marko_helpers = require("marko/src/runtime/html/helpers"), + marko_escapeXml = marko_helpers.x; + +function runIt(fn) { + fn() +}; + +function render(input, out, __component, component, state) { + var data = input; + + out.w("
Broken [" + + marko_escapeXml(state.message) + + "]
"); +} + +marko_template._ = marko_renderer(render, { + ___type: marko_componentType + }, marko_component); + +marko_template.Component = marko_defineComponent(marko_component, marko_template._); + +marko_template.meta = { + id: "/marko-test$1.0.0/components-compilation/fixtures-html/arrow-functions/index.marko", + component: "./" + }; diff --git a/test/components-compilation/fixtures-html/arrow-functions/index.marko b/test/components-compilation/fixtures-html/arrow-functions/index.marko new file mode 100644 index 000000000..54ff5fba2 --- /dev/null +++ b/test/components-compilation/fixtures-html/arrow-functions/index.marko @@ -0,0 +1,19 @@ +static { + function runIt(fn) { + fn() + } +} +class { + onCreate() { + this.state = { + message : "didnt run it" + } + if (true) { + runIt(()=>{ + this.state.message = "ran it" + }) + } + + } +} +
Broken [${state.message}]
\ No newline at end of file diff --git a/test/components-compilation/fixtures-html/arrow-functions/test.js b/test/components-compilation/fixtures-html/arrow-functions/test.js new file mode 100644 index 000000000..2e2abbd97 --- /dev/null +++ b/test/components-compilation/fixtures-html/arrow-functions/test.js @@ -0,0 +1 @@ +module.exports.fails = "issue #1181";