vsn 0.1.69 → 0.1.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/demo/vsn.js +2 -2
- package/demo/xhr.html +6 -68
- package/dist/vsn.min.js +2 -0
- package/package.json +1 -1
- package/src/AST/FunctionCallNode.ts +22 -10
- package/src/AST/FunctionNode.ts +1 -0
- package/test/AST/ClassNode.spec.ts +29 -0
package/demo/xhr.html
CHANGED
|
@@ -1,74 +1,12 @@
|
|
|
1
1
|
<div id="huh-wut" vsn-scope>
|
|
2
|
-
<style>
|
|
3
|
-
bb,
|
|
4
|
-
.something-special {
|
|
5
|
-
display: block;
|
|
6
|
-
}
|
|
7
|
-
</style>
|
|
8
2
|
<script vsn-script type="text/vsn">
|
|
9
|
-
class
|
|
10
|
-
func
|
|
11
|
-
|
|
12
|
-
$color = "#ff00ff";
|
|
13
|
-
something = "something";
|
|
14
|
-
@originaltext = @text;
|
|
15
|
-
@text = 'huh?';
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
func deconstruct() {
|
|
19
|
-
$color = '#000000';
|
|
20
|
-
something = null;
|
|
21
|
-
@text = @originaltext;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
on click() {
|
|
25
|
-
log('clicky');
|
|
26
|
-
t();
|
|
3
|
+
class simple {
|
|
4
|
+
func test() {
|
|
5
|
+
return "test";
|
|
27
6
|
}
|
|
28
|
-
|
|
29
|
-
on hover() {
|
|
30
|
-
b|integer = 1;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
func t() {
|
|
34
|
-
count += 1;
|
|
35
|
-
b += 1;
|
|
36
|
-
if ($color == 'red') {
|
|
37
|
-
$color = 'blue';
|
|
38
|
-
@text = `${count} huh?`;
|
|
39
|
-
} else {
|
|
40
|
-
$color = 'red';
|
|
41
|
-
@text = `${b} wut?`;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
class something-normal {
|
|
47
|
-
on click() {
|
|
48
|
-
log('also clicky');
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
class reset-button {
|
|
53
|
-
func construct() {
|
|
54
|
-
@text = 'reset';
|
|
55
|
-
$color = 'red';
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
on click() {
|
|
59
|
-
?>(:parent:parent).@html = << './xhr.html';
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
?>(:parent).huh_wut = 1;
|
|
64
|
-
func add(a, b) {
|
|
65
|
-
?(bb).@text = `asd 123 ${a} ${b} hmm?`;
|
|
66
|
-
return a + b;
|
|
67
7
|
}
|
|
68
8
|
</script>
|
|
69
|
-
<div class="
|
|
70
|
-
<div class="
|
|
71
|
-
|
|
72
|
-
<span vsn-bind="huh_wut"></span>
|
|
73
|
-
<a href="" vsn-on:click|preventdefault="huh_wut = add(huh_wut, 1)">Click me!</a>
|
|
9
|
+
<div class="simple">asd</div>
|
|
10
|
+
<div class="simple">asd</div>
|
|
11
|
+
|
|
74
12
|
</div>
|