mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
update to latest htmljs-parser and add new-style scriptlet test
This commit is contained in:
parent
44c38e74ad
commit
1852e378f0
@ -59,7 +59,7 @@
|
||||
"events": "^1.0.2",
|
||||
"events-light": "^1.0.0",
|
||||
"he": "^1.1.0",
|
||||
"htmljs-parser": "^2.2.3",
|
||||
"htmljs-parser": "^2.3.0",
|
||||
"lasso-modules-client": "^2.0.3",
|
||||
"lasso-package-root": "^1.0.0",
|
||||
"listener-tracker": "^2.0.0",
|
||||
|
||||
24
test/autotests/compiler/scriptlet-line-block/expected.js
Normal file
24
test/autotests/compiler/scriptlet-line-block/expected.js
Normal file
@ -0,0 +1,24 @@
|
||||
var marko_template = module.exports = require("marko/html").t(__filename),
|
||||
marko_helpers = require("marko/runtime/html/helpers"),
|
||||
marko_escapeXml = marko_helpers.x;
|
||||
|
||||
function render(input, out) {
|
||||
var data = input;
|
||||
|
||||
var foo = 123;
|
||||
|
||||
function bar() {
|
||||
|
||||
}
|
||||
var baz = 456;
|
||||
|
||||
out.w("<div>");
|
||||
|
||||
console.log('foo');
|
||||
|
||||
out.w(" Hello there " +
|
||||
marko_escapeXml(name) +
|
||||
"</div>");
|
||||
}
|
||||
|
||||
marko_template._ = render;
|
||||
13
test/autotests/compiler/scriptlet-line-block/template.marko
Normal file
13
test/autotests/compiler/scriptlet-line-block/template.marko
Normal file
@ -0,0 +1,13 @@
|
||||
$ var foo = 123;
|
||||
|
||||
$ {
|
||||
function bar() {
|
||||
|
||||
}
|
||||
var baz = 456;
|
||||
}
|
||||
|
||||
<div>
|
||||
$ console.log('foo');
|
||||
Hello there ${name}
|
||||
</div>
|
||||
Loading…
x
Reference in New Issue
Block a user