fix compiler authoring traps and showcase generation order

This commit is contained in:
2026-08-09 14:22:12 +05:30
parent 2e5c0cc953
commit 09ebd44b6c
29 changed files with 1437 additions and 5101 deletions
+21
View File
@@ -1499,3 +1499,24 @@ test("a boolean attribute bound to a loop variable binds on the client", () => {
expect(code).not.toContain('__wireBooleanAttr("checked"');
expect(code).toContain("data-wrn-bind-");
});
test("block comments inside props report the authoring restriction", () => {
expect(() =>
compileWireFile(`component Example {
props {
/* use a line comment */
label: string = "Example"
}
view { <span>{label}</span> }
}`),
).toThrow("Block comments are not allowed inside props {}; use // line comments instead");
});
test("state page reports its collision with the page keyword", () => {
expect(() =>
compileWireFile(`page Example {
state page = 1
view { <span>{page}</span> }
}`),
).toThrow("State name 'page' collides with the WRN 'page' keyword");
});