@seanox/aspect-js
Version:
full stack JavaScript framework for SPAs incl. reactivity rendering, mvc / mvvm, models, expression language, datasource, routing, paths, unit test and some more
114 lines (99 loc) • 3.38 kB
HTML
<html>
<head>
<meta charset="ISO-8859-1">
<title>Seanox aspect-js test environment</title>
<style>
body {
font-family: monospace;
white-space: pre;
}
</style>
<script src="aspect-js.js"></script>
<script src="expression.js"></script>
<script type="text/javascript">
Test.activate();
const TestModel_1 = {
field_1: "f1",
field_2: "f2",
method_1() {
return "m1";
},
method_2(value_1) {
return "m2" + value_1;
},
get field_3() {
return "f3";
},
get field_11() {
return [{x:{y:"f11[0]->x->y"}}];
},
get field_12() {
return [{x:[{y:"f12[0]->x->y"}]}];
}
};
Test.create({test() {
const pattern = Test.read("expression_parse_" + navigator.engine + ".txt");
try {Assert.assertSameText(pattern, document.body.innerHTML);
} catch (error) {
console.log(document.body.innerHTML);
throw error;
}
}});
Composite.listen(Composite.EVENT_RENDER_END, () => {
Test.start();
});
</script>
</head>
<body>
{{navigator.engine}}
----
Literal 01: {{'Literal 01'}}
Literal 02: {{"Literal 02"}}
Literal 03: {{'Literal 01' + "Literal 02"}}
Logic 01: {{1 +2}}
Method EL 01: {{TestModel_1.method_1()}}
Method EL 02: {{TestModel_1.method_1(1)}}
Method EL 03: {{TestModel_1.method_2()}}
Method EL 04: {{TestModel_1.method_2(2)}}
Method EL 05: {{TestModel_1.method_2(2, 3)}}
Method EL Error 01: {{xxx.yyy.zzz()}}
Value EL 00: {{TestModel_1}}
Value EL 01: {{TestModel_1.field_1}}
Value EL 02: {{TestModel_1.field_2}}
Value EL 03: {{TestModel_1.field_3}}
Value EL 04: {{TestModel_1.method_1}}
Value EL 11_1: {{TestModel_1.field_11}}
Value EL 11_2: {{TestModel_1.field_11[0]}}
Value EL 11_3: {{TestModel_1.field_11[1]}}
Value EL 11_4: {{TestModel_1.field_11[0].x}}
Value EL 11_5: {{TestModel_1.field_11[1].x}}
Value EL 11_6: {{TestModel_1.field_11[0].x.y}}
Value EL 11_7: {{TestModel_1.field_11[1].x.y}}
Value EL 12_1: {{TestModel_1.field_12}}
Value EL 12_2: {{TestModel_1.field_12[0]}}
Value EL 12_3: {{TestModel_1.field_12[1]}}
Value EL 12_4: {{TestModel_1.field_12[0].x}}
Value EL 12_5: {{TestModel_1.field_12[1].x}}
Value EL 12_6: {{TestModel_1.field_12[0].x.y}}
Value EL 12_7: {{TestModel_1.field_12[1].x.y}}
Value EL 12_8: {{TestModel_1.field_12[0].x[0].y}}
Value EL 12_9: {{TestModel_1.field_12[1].x[0].y}}
Value EL 12_A: {{TestModel_1.field_12[0].x[1].y}}
Value EL 12_B: {{TestModel_1.field_12[1].x[1].y}}
Value EL Error 01: {{xxx.yyy.zzz}}
Mix 01: {{'Literal 01' + TestModel_1.method_1()}}
Condition 01: {{1 gt 2}}
Condition 01: {{not (1 gt 2)}}
Condition 01: {{1 not gt 2}}
Condition 01: {{typeof 2}}
{{}}
{{ }}
{{ - }}
{{
1
+2
+3
}}
</body>
</html>