Skip to content

Commit de6e1d4

Browse files
committed
WIP: add failing test
1 parent 681661a commit de6e1d4

File tree

16 files changed

+203
-0
lines changed

16 files changed

+203
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"vars": {
3+
"props": {
4+
"$_": "r",
5+
"$init": "n"
6+
}
7+
}
8+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Render
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Render
2+
```html
3+
<!---->
4+
<!---->
5+
```
6+
7+
# Mutations
8+
```
9+
INSERT #comment0, #text, #comment1
10+
```
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export const $template = "";
2+
export const $walks = "";
3+
export const $setup = () => {};
4+
import * as _ from "@marko/runtime-tags/debug/dom";
5+
const $input_valueChange__script = _._script("__tests__/tags/child.marko_0_input_valueChange", ({
6+
input_valueChange
7+
}) => input_valueChange(1));
8+
export const $input_valueChange = /* @__PURE__ */_._const("input_valueChange", $input_valueChange__script);
9+
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => $input_valueChange($scope, input.valueChange));
10+
export default /* @__PURE__ */_._template("__tests__/tags/child.marko", $template, $walks, $setup, $input);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export const $template = "";
2+
export const $walks = "";
3+
export const $setup = () => {};
4+
import * as _ from "@marko/runtime-tags/debug/dom";
5+
export const $input_valueChange = /* @__PURE__ */_._const("input_valueChange", ($scope, input_valueChange) => _._return($scope, $_return($scope)));
6+
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => $input_valueChange($scope, input.valueChange));
7+
function $_return({
8+
input_valueChange
9+
}) {
10+
return function () {
11+
input_valueChange(1);
12+
};
13+
}
14+
_._resume("__tests__/tags/let-batch.marko_0/_return", $_return);
15+
export default /* @__PURE__ */_._template("__tests__/tags/let-batch.marko", $template, $walks, $setup, $input);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// size: 225 (min) 123 (brotli)
2+
(_._resume("b0", function ({ 2: input_valueChange }) {
3+
return function () {
4+
input_valueChange(1);
5+
};
6+
}),
7+
_._script("a0", ({ 2: input_valueChange }) => input_valueChange(1)),
8+
_._var_resume("c2", _._const(3)),
9+
_._resume("c1", function ({ _: { 3: setter } }) {
10+
return function () {
11+
setter();
12+
};
13+
}),
14+
_._resume("c0", function ($scope) {
15+
return (_new_value) => {};
16+
}),
17+
init());
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
export const $template = `<!>${_letBatch_template}<!><!>`;
2+
export const $walks = /* over(1), beginChildWithVar, _letBatch_walks, endChild, replace, over(2) */`b0${_letBatch_walks}&%c`;
3+
import * as _ from "@marko/runtime-tags/debug/dom";
4+
import { $setup as _letBatch, $input_valueChange as _letBatch_input_valueChange, $template as _letBatch_template, $walks as _letBatch_walks } from "./tags/let-batch.marko";
5+
import { $setup as _child, $input_valueChange as _child_input_valueChange, $template as _child_template, $walks as _child_walks } from "./tags/child.marko";
6+
const $if_content__setup = $scope => {
7+
_child($scope["#childScope/0"]);
8+
$if_content__setter._($scope);
9+
};
10+
const $if_content__setter = /* @__PURE__ */_._if_closure("setter", "#text/2", 0, ($scope, setter) => _child_input_valueChange($scope["#childScope/0"], $valueChange2($scope)));
11+
const $if_content = /* @__PURE__ */_._content_branch(_child_template, /* beginChild, _child_walks, endChild */`/${_child_walks}&`, $if_content__setup);
12+
const $if = /* @__PURE__ */_._if("#text/2", $if_content);
13+
export function $setup($scope) {
14+
_._var($scope, "#childScope/0", $setter);
15+
_letBatch($scope["#childScope/0"]);
16+
_letBatch_input_valueChange($scope["#childScope/0"], $valueChange($scope));
17+
/* value */0;
18+
$if($scope, true ? 0 : 1);
19+
}
20+
const $setter = _._var_resume("__tests__/template.marko_0_setter/var", /* @__PURE__ */_._const("setter"));
21+
function $valueChange2({
22+
_: {
23+
setter
24+
}
25+
}) {
26+
return function () {
27+
setter();
28+
};
29+
}
30+
function $valueChange($scope) {
31+
return _new_value => {
32+
/* value */_new_value;
33+
};
34+
}
35+
_._resume("__tests__/template.marko_1/valueChange2", $valueChange2);
36+
_._resume("__tests__/template.marko_0/valueChange", $valueChange);
37+
export default /* @__PURE__ */_._template("__tests__/template.marko", $template, $walks, $setup);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import * as _ from "@marko/runtime-tags/debug/html";
2+
export default _._template("__tests__/tags/child.marko", input => {
3+
const $scope0_id = _._scope_id();
4+
_._script($scope0_id, "__tests__/tags/child.marko_0_input_valueChange");
5+
_._scope($scope0_id, {
6+
input_valueChange: input.valueChange
7+
}, "__tests__/tags/child.marko", 0, {
8+
input_valueChange: ["input.valueChange"]
9+
});
10+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import * as _ from "@marko/runtime-tags/debug/html";
2+
export default _._template("__tests__/tags/let-batch.marko", input => {
3+
const $scope0_id = _._scope_id();
4+
const $return = _._resume(function () {
5+
input.valueChange(1);
6+
}, "__tests__/tags/let-batch.marko_0/_return", $scope0_id);
7+
_._scope($scope0_id, {
8+
input_valueChange: input.valueChange
9+
}, "__tests__/tags/let-batch.marko", 0, {
10+
input_valueChange: ["input.valueChange"]
11+
});
12+
return $return;
13+
});
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import _letBatch from "./tags/let-batch.marko";
2+
import _child from "./tags/child.marko";
3+
import * as _ from "@marko/runtime-tags/debug/html";
4+
export default _._template("__tests__/template.marko", input => {
5+
const $scope0_id = _._scope_id();
6+
let value = 0;
7+
let setter = _letBatch({
8+
valueChange: _._resume(_new_value => {
9+
value = _new_value;
10+
}, "__tests__/template.marko_0/valueChange", $scope0_id)
11+
});
12+
if (true) {
13+
const $scope1_id = _._scope_id();
14+
_child({
15+
valueChange: _._resume(function () {
16+
setter();
17+
}, "__tests__/template.marko_1/valueChange2", $scope1_id)
18+
});
19+
_._scope($scope1_id, {
20+
_: _._scope_with_id($scope0_id)
21+
}, "__tests__/template.marko", "3:2");
22+
}
23+
_._scope($scope0_id, {
24+
setter
25+
}, "__tests__/template.marko", 0, {
26+
setter: "2:12"
27+
});
28+
});

0 commit comments

Comments
 (0)