Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

walt-compiler

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

walt-compiler - npm Package Compare versions

Comparing version 0.18.0 to 0.19.0

src/generator/assignment-expression.js

6

package.json
{
"name": "walt-compiler",
"version": "0.18.0",
"version": "0.19.0",
"description": "Alternative syntax for WebAssembly text format",

@@ -47,4 +47,4 @@ "main": "dist/walt.js",

"nearley": "^2.15.1",
"walt-parser-tools": "^0.2.6",
"walt-syntax": "^0.5.0",
"walt-parser-tools": "^0.2.7",
"walt-syntax": "^0.6.0",
"wasm-types": "1.0.3"

@@ -51,0 +51,0 @@ },

@@ -68,3 +68,3 @@ # Snapshot report for `src/__tests__/compiler-spec.js`

at global (undefined:7:10)␊
`

@@ -77,2 +77,2 @@ ## throws

message: 'unreachable',
}
}

@@ -11,293 +11,293 @@ # Snapshot report for `src/__tests__/type-conversion-spec.js`

`00000000: 6d736100 ; \\0asm␊
00000004: 1 ; version 1␊
00000008: 1 ; Types section␊
00000009: 1c ; size␊
0000000a: 6 ; count␊
0000000b: 60 ; func type (0)␊
0000000c: 0 ; parameter count␊
0000000d: 1 ; result count␊
0000000e: 7d ; result type f32␊
0000000f: 60 ; func type (1)␊
00000010: 1 ; parameter count␊
00000011: 7f ; param␊
00000012: 1 ; result count␊
00000013: 7d ; result type f32␊
00000014: 60 ; func type (2)␊
00000015: 1 ; parameter count␊
00000016: 7d ; param␊
00000017: 1 ; result count␊
00000018: 7f ; result type i32␊
00000019: 60 ; func type (3)␊
0000001a: 0 ; parameter count␊
0000001b: 1 ; result count␊
0000001c: 7f ; result type i32␊
0000001d: 60 ; func type (4)␊
0000001e: 1 ; parameter count␊
0000001f: 7c ; param␊
00000020: 1 ; result count␊
00000021: 7d ; result type f32␊
00000022: 60 ; func type (5)␊
00000023: 0 ; parameter count␊
00000024: 1 ; result count␊
00000025: 7c ; result type f64␊
00000026: 3 ; Functions section␊
00000027: 9 ; size␊
00000028: 8 ; count␊
00000029: 0 ; type index␊
0000002a: 1 ; type index␊
0000002b: 2 ; type index␊
0000002c: 1 ; type index␊
0000002d: 3 ; type index␊
0000002e: 4 ; type index␊
0000002f: 0 ; type index␊
00000030: 5 ; type index␊
00000031: 7 ; Exports section␊
00000032: 86,1 ; size␊
00000034: 8 ; count␊
00000035: 8 ; field␊
00000036: 63 ; c␊
00000037: 6f ; o␊
00000038: 6e ; n␊
00000039: 73 ; s␊
0000003a: 74 ; t␊
0000003b: 61 ; a␊
0000003c: 6e ; n␊
0000003d: 74 ; t␊
0000003e: 0 ; Global␊
0000003f: 0 ; index␊
00000040: 10 ; field␊
00000041: 76 ; v␊
00000042: 61 ; a␊
00000043: 72 ; r␊
00000044: 69 ; i␊
00000045: 61 ; a␊
00000046: 62 ; b␊
00000047: 6c ; l␊
00000048: 65 ; e␊
00000049: 54 ; T␊
0000004a: 79 ; y␊
0000004b: 70 ; p␊
0000004c: 65 ; e␊
0000004d: 63 ; c␊
0000004e: 61 ; a␊
0000004f: 73 ; s␊
00000050: 74 ; t␊
00000051: 0 ; Global␊
00000052: 1 ; index␊
00000053: e ; field␊
00000054: 5f ; _␊
00000055: 33 ; 3␊
00000056: 32 ; 2␊
00000057: 49 ; I␊
00000058: 6e ; n␊
00000059: 74 ; t␊
0000005a: 54 ; T␊
0000005b: 79 ; y␊
0000005c: 70 ; p␊
0000005d: 65 ; e␊
0000005e: 63 ; c␊
0000005f: 61 ; a␊
00000060: 73 ; s␊
00000061: 74 ; t␊
00000062: 0 ; Global␊
00000063: 2 ; index␊
00000064: 10 ; field␊
00000065: 5f ; _␊
00000066: 33 ; 3␊
00000067: 32 ; 2␊
00000068: 46 ; F␊
00000069: 6c ; l␊
0000006a: 6f ; o␊
0000006b: 61 ; a␊
0000006c: 74 ; t␊
0000006d: 54 ; T␊
0000006e: 79 ; y␊
0000006f: 70 ; p␊
00000070: 65 ; e␊
00000071: 63 ; c␊
00000072: 61 ; a␊
00000073: 73 ; s␊
00000074: 74 ; t␊
00000075: 0 ; Global␊
00000076: 3 ; index␊
00000077: e ; field␊
00000078: 5f ; _␊
00000079: 36 ; 6␊
0000007a: 34 ; 4␊
0000007b: 49 ; I␊
0000007c: 6e ; n␊
0000007d: 74 ; t␊
0000007e: 54 ; T␊
0000007f: 79 ; y␊
00000080: 70 ; p␊
00000081: 65 ; e␊
00000082: 63 ; c␊
00000083: 61 ; a␊
00000084: 73 ; s␊
00000085: 74 ; t␊
00000086: 0 ; Global␊
00000087: 4 ; index␊
00000088: 10 ; field␊
00000089: 5f ; _␊
0000008a: 36 ; 6␊
0000008b: 34 ; 4␊
0000008c: 46 ; F␊
0000008d: 6c ; l␊
0000008e: 6f ; o␊
0000008f: 61 ; a␊
00000090: 74 ; t␊
00000091: 54 ; T␊
00000092: 79 ; y␊
00000093: 70 ; p␊
00000094: 65 ; e␊
00000095: 63 ; c␊
00000096: 61 ; a␊
00000097: 73 ; s␊
00000098: 74 ; t␊
00000099: 0 ; Global␊
0000009a: 5 ; index␊
0000009b: a ; field␊
0000009c: 70 ; p␊
0000009d: 72 ; r␊
0000009e: 6f ; o␊
0000009f: 6d ; m␊
000000a0: 6f ; o␊
000000a1: 74 ; t␊
000000a2: 69 ; i␊
000000a3: 6f ; o␊
000000a4: 6e ; n␊
000000a5: 73 ; s␊
000000a6: 0 ; Global␊
000000a7: 6 ; index␊
000000a8: f ; field␊
000000a9: 70 ; p␊
000000aa: 72 ; r␊
000000ab: 6f ; o␊
000000ac: 6d ; m␊
000000ad: 6f ; o␊
000000ae: 74 ; t␊
000000af: 65 ; e␊
000000b0: 46 ; F␊
000000b1: 33 ; 3␊
000000b2: 32 ; 2␊
000000b3: 74 ; t␊
000000b4: 6f ; o␊
000000b5: 46 ; F␊
000000b6: 36 ; 6␊
000000b7: 34 ; 4␊
000000b8: 0 ; Global␊
000000b9: 7 ; index␊
000000ba: a ; Code section␊
000000bb: 8a,1 ; size␊
000000bd: 8 ; function count␊
000000be: 8 ; Function constant␊
000000bf: 0 ; locals count␊
000000c0: 43 ; f32.const ␊
000000c1: 0.8 ; f32.literal␊
000000c5: f ; return ␊
000000c6: b ; end␊
000000c7: c ; Function variableTypecast␊
000000c8: 0 ; locals count␊
000000c9: 20 ; get_local x<i32>␊
000000ca: 0 ; i32.literal␊
000000cb: b2 ; f32.convert_s/i32 ␊
000000cc: 43 ; f32.const ␊
000000cd: 5 ; f32.literal␊
000000d1: 92 ; f32.add ␊
000000d2: f ; return ␊
000000d3: b ; end␊
000000d4: 9 ; Function _32IntTypecast␊
000000d5: 0 ; locals count␊
000000d6: 20 ; get_local x<f32>␊
000000d7: 0 ; i32.literal␊
000000d8: a8 ; i32.trunc_s/f32 ␊
000000d9: 41 ; i32.const ␊
000000da: 2 ; i32.literal␊
000000db: 6a ; i32.add ␊
000000dc: f ; return ␊
000000dd: b ; end␊
000000de: 12 ; Function _32FloatTypecast␊
000000df: 0 ; locals count␊
000000e0: 43 ; f32.const ␊
000000e1: 2.8 ; f32.literal␊
000000e5: 20 ; get_local x<i32>␊
000000e6: 0 ; i32.literal␊
000000e7: b2 ; f32.convert_s/i32 ␊
000000e8: 92 ; f32.add ␊
000000e9: 43 ; f32.const ␊
000000ea: 0.8 ; f32.literal␊
000000ee: 92 ; f32.add ␊
000000ef: f ; return ␊
000000f0: b ; end␊
000000f1: 10 ; Function _64IntTypecast␊
000000f2: 1 ; locals count␊
000000f3: 1 ; number of locals of following type␊
000000f4: 7e ; i64␊
000000f5: 42 ; i64.const ␊
000000f6: 2 ; i64.literal␊
000000f7: 21 ; set_local x<i64>␊
000000f8: 0 ; i32.literal␊
000000f9: 41 ; i32.const ␊
000000fa: 2 ; i32.literal␊
000000fb: ac ; i64.extend_s/i32 ␊
000000fc: 20 ; get_local x<i64>␊
000000fd: 0 ; i32.literal␊
000000fe: 7e ; i64.mul ␊
000000ff: a7 ; i32.wrap/i64 ␊
00000100: f ; return ␊
00000101: b ; end␊
00000102: a ; Function _64FloatTypecast␊
00000103: 0 ; locals count␊
00000104: 41 ; i32.const ␊
00000105: 2 ; i32.literal␊
00000106: b7 ; f64.convert_s/i32 ␊
00000107: 20 ; get_local x<f64>␊
00000108: 0 ; i32.literal␊
00000109: a2 ; f64.mul ␊
0000010a: b6 ; f32.demote/f64 ␊
0000010b: f ; return ␊
0000010c: b ; end␊
0000010d: 19 ; Function promotions␊
0000010e: 0 ; locals count␊
0000010f: 43 ; f32.const ␊
00000110: 2.8 ; f32.literal␊
00000114: 41 ; i32.const ␊
00000115: 2 ; i32.literal␊
00000116: b2 ; f32.convert_s/i32 ␊
00000117: 92 ; f32.add ␊
00000118: 43 ; f32.const ␊
00000119: 0.8 ; f32.literal␊
0000011d: 41 ; i32.const ␊
0000011e: a ; i32.literal␊
0000011f: 41 ; i32.const ␊
00000120: 5 ; i32.literal␊
00000121: 6d ; i32.div_s ␊
00000122: b2 ; f32.convert_s/i32 ␊
00000123: 94 ; f32.mul ␊
00000124: 92 ; f32.add ␊
00000125: f ; return ␊
00000126: b ; end␊
00000127: 1f ; Function promoteF32toF64␊
00000128: 2 ; locals count␊
00000129: 1 ; number of locals of following type␊
0000012a: 7c ; f64␊
0000012b: 1 ; number of locals of following type␊
0000012c: 7d ; f32␊
0000012d: 44 ; f64.const ␊
0000012e: 2 ; f64.literal␊
00000136: 21 ; set_local x<f64>␊
00000137: 0 ; i32.literal␊
00000138: 43 ; f32.const ␊
00000139: 2 ; f32.literal␊
0000013d: 21 ; set_local y<f32>␊
0000013e: 1 ; i32.literal␊
0000013f: 20 ; get_local x<f64>␊
00000140: 0 ; i32.literal␊
00000141: 20 ; get_local y<f32>␊
00000142: 1 ; i32.literal␊
00000143: bb ; f64.promote/f32 ␊
00000144: a0 ; f64.add ␊
00000145: f ; return ␊
00000146: b ; end␊
` 0 0x0: 6d736100 ; \\0asm␊
4 0x4: 1 ; version 1␊
8 0x8: 1 ; Types section␊
9 0x9: 1c ; size␊
10 0xa: 6 ; count␊
11 0xb: 60 ; func type (0)␊
12 0xc: 0 ; parameter count␊
13 0xd: 1 ; result count␊
14 0xe: 7d ; result type f32␊
15 0xf: 60 ; func type (1)␊
16 0x10: 1 ; parameter count␊
17 0x11: 7f ; param␊
18 0x12: 1 ; result count␊
19 0x13: 7d ; result type f32␊
20 0x14: 60 ; func type (2)␊
21 0x15: 1 ; parameter count␊
22 0x16: 7d ; param␊
23 0x17: 1 ; result count␊
24 0x18: 7f ; result type i32␊
25 0x19: 60 ; func type (3)␊
26 0x1a: 0 ; parameter count␊
27 0x1b: 1 ; result count␊
28 0x1c: 7f ; result type i32␊
29 0x1d: 60 ; func type (4)␊
30 0x1e: 1 ; parameter count␊
31 0x1f: 7c ; param␊
32 0x20: 1 ; result count␊
33 0x21: 7d ; result type f32␊
34 0x22: 60 ; func type (5)␊
35 0x23: 0 ; parameter count␊
36 0x24: 1 ; result count␊
37 0x25: 7c ; result type f64␊
38 0x26: 3 ; Functions section␊
39 0x27: 9 ; size␊
40 0x28: 8 ; count␊
41 0x29: 0 ; type index␊
42 0x2a: 1 ; type index␊
43 0x2b: 2 ; type index␊
44 0x2c: 1 ; type index␊
45 0x2d: 3 ; type index␊
46 0x2e: 4 ; type index␊
47 0x2f: 0 ; type index␊
48 0x30: 5 ; type index␊
49 0x31: 7 ; Exports section␊
50 0x32: 86,1 ; size␊
52 0x34: 8 ; count␊
53 0x35: 8 ; field␊
54 0x36: 63 ; c␊
55 0x37: 6f ; o␊
56 0x38: 6e ; n␊
57 0x39: 73 ; s␊
58 0x3a: 74 ; t␊
59 0x3b: 61 ; a␊
60 0x3c: 6e ; n␊
61 0x3d: 74 ; t␊
62 0x3e: 0 ; Global␊
63 0x3f: 0 ; index␊
64 0x40: 10 ; field␊
65 0x41: 76 ; v␊
66 0x42: 61 ; a␊
67 0x43: 72 ; r␊
68 0x44: 69 ; i␊
69 0x45: 61 ; a␊
70 0x46: 62 ; b␊
71 0x47: 6c ; l␊
72 0x48: 65 ; e␊
73 0x49: 54 ; T␊
74 0x4a: 79 ; y␊
75 0x4b: 70 ; p␊
76 0x4c: 65 ; e␊
77 0x4d: 63 ; c␊
78 0x4e: 61 ; a␊
79 0x4f: 73 ; s␊
80 0x50: 74 ; t␊
81 0x51: 0 ; Global␊
82 0x52: 1 ; index␊
83 0x53: e ; field␊
84 0x54: 5f ; _␊
85 0x55: 33 ; 3␊
86 0x56: 32 ; 2␊
87 0x57: 49 ; I␊
88 0x58: 6e ; n␊
89 0x59: 74 ; t␊
90 0x5a: 54 ; T␊
91 0x5b: 79 ; y␊
92 0x5c: 70 ; p␊
93 0x5d: 65 ; e␊
94 0x5e: 63 ; c␊
95 0x5f: 61 ; a␊
96 0x60: 73 ; s␊
97 0x61: 74 ; t␊
98 0x62: 0 ; Global␊
99 0x63: 2 ; index␊
100 0x64: 10 ; field␊
101 0x65: 5f ; _␊
102 0x66: 33 ; 3␊
103 0x67: 32 ; 2␊
104 0x68: 46 ; F␊
105 0x69: 6c ; l␊
106 0x6a: 6f ; o␊
107 0x6b: 61 ; a␊
108 0x6c: 74 ; t␊
109 0x6d: 54 ; T␊
110 0x6e: 79 ; y␊
111 0x6f: 70 ; p␊
112 0x70: 65 ; e␊
113 0x71: 63 ; c␊
114 0x72: 61 ; a␊
115 0x73: 73 ; s␊
116 0x74: 74 ; t␊
117 0x75: 0 ; Global␊
118 0x76: 3 ; index␊
119 0x77: e ; field␊
120 0x78: 5f ; _␊
121 0x79: 36 ; 6␊
122 0x7a: 34 ; 4␊
123 0x7b: 49 ; I␊
124 0x7c: 6e ; n␊
125 0x7d: 74 ; t␊
126 0x7e: 54 ; T␊
127 0x7f: 79 ; y␊
128 0x80: 70 ; p␊
129 0x81: 65 ; e␊
130 0x82: 63 ; c␊
131 0x83: 61 ; a␊
132 0x84: 73 ; s␊
133 0x85: 74 ; t␊
134 0x86: 0 ; Global␊
135 0x87: 4 ; index␊
136 0x88: 10 ; field␊
137 0x89: 5f ; _␊
138 0x8a: 36 ; 6␊
139 0x8b: 34 ; 4␊
140 0x8c: 46 ; F␊
141 0x8d: 6c ; l␊
142 0x8e: 6f ; o␊
143 0x8f: 61 ; a␊
144 0x90: 74 ; t␊
145 0x91: 54 ; T␊
146 0x92: 79 ; y␊
147 0x93: 70 ; p␊
148 0x94: 65 ; e␊
149 0x95: 63 ; c␊
150 0x96: 61 ; a␊
151 0x97: 73 ; s␊
152 0x98: 74 ; t␊
153 0x99: 0 ; Global␊
154 0x9a: 5 ; index␊
155 0x9b: a ; field␊
156 0x9c: 70 ; p␊
157 0x9d: 72 ; r␊
158 0x9e: 6f ; o␊
159 0x9f: 6d ; m␊
160 0xa0: 6f ; o␊
161 0xa1: 74 ; t␊
162 0xa2: 69 ; i␊
163 0xa3: 6f ; o␊
164 0xa4: 6e ; n␊
165 0xa5: 73 ; s␊
166 0xa6: 0 ; Global␊
167 0xa7: 6 ; index␊
168 0xa8: f ; field␊
169 0xa9: 70 ; p␊
170 0xaa: 72 ; r␊
171 0xab: 6f ; o␊
172 0xac: 6d ; m␊
173 0xad: 6f ; o␊
174 0xae: 74 ; t␊
175 0xaf: 65 ; e␊
176 0xb0: 46 ; F␊
177 0xb1: 33 ; 3␊
178 0xb2: 32 ; 2␊
179 0xb3: 74 ; t␊
180 0xb4: 6f ; o␊
181 0xb5: 46 ; F␊
182 0xb6: 36 ; 6␊
183 0xb7: 34 ; 4␊
184 0xb8: 0 ; Global␊
185 0xb9: 7 ; index␊
186 0xba: a ; Code section␊
187 0xbb: 8a,1 ; size␊
189 0xbd: 8 ; function count␊
190 0xbe: 8 ; Function constant␊
191 0xbf: 0 ; locals count␊
192 0xc0: 43 ; f32.const ␊
193 0xc1: 0.8 ; f32.literal␊
197 0xc5: f ; return ␊
198 0xc6: b ; end␊
199 0xc7: c ; Function variableTypecast␊
200 0xc8: 0 ; locals count␊
201 0xc9: 20 ; get_local x<i32>␊
202 0xca: 0 ; i32.literal␊
203 0xcb: b2 ; f32.convert_s/i32 ␊
204 0xcc: 43 ; f32.const ␊
205 0xcd: 5 ; f32.literal␊
209 0xd1: 92 ; f32.add ␊
210 0xd2: f ; return ␊
211 0xd3: b ; end␊
212 0xd4: 9 ; Function _32IntTypecast␊
213 0xd5: 0 ; locals count␊
214 0xd6: 20 ; get_local x<f32>␊
215 0xd7: 0 ; i32.literal␊
216 0xd8: a8 ; i32.trunc_s/f32 ␊
217 0xd9: 41 ; i32.const ␊
218 0xda: 2 ; i32.literal␊
219 0xdb: 6a ; i32.add ␊
220 0xdc: f ; return ␊
221 0xdd: b ; end␊
222 0xde: 12 ; Function _32FloatTypecast␊
223 0xdf: 0 ; locals count␊
224 0xe0: 43 ; f32.const ␊
225 0xe1: 2.8 ; f32.literal␊
229 0xe5: 20 ; get_local x<i32>␊
230 0xe6: 0 ; i32.literal␊
231 0xe7: b2 ; f32.convert_s/i32 ␊
232 0xe8: 92 ; f32.add ␊
233 0xe9: 43 ; f32.const ␊
234 0xea: 0.8 ; f32.literal␊
238 0xee: 92 ; f32.add ␊
239 0xef: f ; return ␊
240 0xf0: b ; end␊
241 0xf1: 10 ; Function _64IntTypecast␊
242 0xf2: 1 ; locals count␊
243 0xf3: 1 ; number of locals of following type␊
244 0xf4: 7e ; i64␊
245 0xf5: 42 ; i64.const ␊
246 0xf6: 2 ; i64.literal␊
247 0xf7: 21 ; set_local x<i64>␊
248 0xf8: 0 ; i32.literal␊
249 0xf9: 41 ; i32.const ␊
250 0xfa: 2 ; i32.literal␊
251 0xfb: ac ; i64.extend_s/i32 ␊
252 0xfc: 20 ; get_local x<i64>␊
253 0xfd: 0 ; i32.literal␊
254 0xfe: 7e ; i64.mul ␊
255 0xff: a7 ; i32.wrap/i64 ␊
256 0x100: f ; return ␊
257 0x101: b ; end␊
258 0x102: a ; Function _64FloatTypecast␊
259 0x103: 0 ; locals count␊
260 0x104: 41 ; i32.const ␊
261 0x105: 2 ; i32.literal␊
262 0x106: b7 ; f64.convert_s/i32 ␊
263 0x107: 20 ; get_local x<f64>␊
264 0x108: 0 ; i32.literal␊
265 0x109: a2 ; f64.mul ␊
266 0x10a: b6 ; f32.demote/f64 ␊
267 0x10b: f ; return ␊
268 0x10c: b ; end␊
269 0x10d: 19 ; Function promotions␊
270 0x10e: 0 ; locals count␊
271 0x10f: 43 ; f32.const ␊
272 0x110: 2.8 ; f32.literal␊
276 0x114: 41 ; i32.const ␊
277 0x115: 2 ; i32.literal␊
278 0x116: b2 ; f32.convert_s/i32 ␊
279 0x117: 92 ; f32.add ␊
280 0x118: 43 ; f32.const ␊
281 0x119: 0.8 ; f32.literal␊
285 0x11d: 41 ; i32.const ␊
286 0x11e: a ; i32.literal␊
287 0x11f: 41 ; i32.const ␊
288 0x120: 5 ; i32.literal␊
289 0x121: 6d ; i32.div_s ␊
290 0x122: b2 ; f32.convert_s/i32 ␊
291 0x123: 94 ; f32.mul ␊
292 0x124: 92 ; f32.add ␊
293 0x125: f ; return ␊
294 0x126: b ; end␊
295 0x127: 1f ; Function promoteF32toF64␊
296 0x128: 2 ; locals count␊
297 0x129: 1 ; number of locals of following type␊
298 0x12a: 7c ; f64␊
299 0x12b: 1 ; number of locals of following type␊
300 0x12c: 7d ; f32␊
301 0x12d: 44 ; f64.const ␊
302 0x12e: 2 ; f64.literal␊
310 0x136: 21 ; set_local x<f64>␊
311 0x137: 0 ; i32.literal␊
312 0x138: 43 ; f32.const ␊
313 0x139: 2 ; f32.literal␊
317 0x13d: 21 ; set_local y<f32>␊
318 0x13e: 1 ; i32.literal␊
319 0x13f: 20 ; get_local x<f64>␊
320 0x140: 0 ; i32.literal␊
321 0x141: 20 ; get_local y<f32>␊
322 0x142: 1 ; i32.literal␊
323 0x143: bb ; f64.promote/f32 ␊
324 0x144: a0 ; f64.add ␊
325 0x145: f ; return ␊
326 0x146: b ; end␊
============ fin =============`

@@ -106,1 +106,37 @@ import test from 'ava';

});
test('tee-local', t => {
const source = `
export function run(iterations: i32) : i32 {
iterations += 1;
let counter : i32 = 0;
while (iterations -= 1) {
counter += 1;
}
return counter;
}`;
return compileAndRun(source).then(({ instance }) => {
t.is(instance.exports.run(10), 10);
});
});
test('ternary', t => {
const source = `
function getY() : i32 {
return 10;
}
function getZ() : i32 {
return -10;
}
export function run(x : i32) : i32 {
// FIXME: using a ternary inside a return currently fails validation,
// looks like the type info is lost (result of the select)
const result : i32 = x ? getY() : getZ();
return result;
}
`;
return compileAndRun(source, {}, { debug: false }).then(({ instance }) => {
t.is(instance.exports.run(1), 10);
t.is(instance.exports.run(0), -10);
});
});

@@ -62,6 +62,9 @@ /**

compileAndRun(`
function getNegative() : i32 {
return -2;
}
export function test(): i32 {
let x: i32 = 2;
let x: i32 = getNegative();
return -x;
}`).then(outputIs(t, -2)));
}`).then(outputIs(t, 2)));

@@ -68,0 +71,0 @@ test('uses precedence correctly', t =>

import test from 'ava';
import { getIR, debug } from '..';
import { getIR } from '..';

@@ -58,3 +58,3 @@ test('objects', t => {

const wasm = getIR(walt);
t.snapshot(debug(wasm));
return WebAssembly.instantiate(wasm.buffer()).then(result => {

@@ -61,0 +61,0 @@ const exports = result.instance.exports;

@@ -101,5 +101,5 @@ /**

[Syntax.Pair]: _next => (args, transform) => {
const [typeCastMaybe, context] = args;
const [typeCast, context] = args;
const params = typeCastMaybe.params.map(p => transform([p, context]));
const params = typeCast.params.map(p => transform([p, context]));
const [targetNode, typeNode] = params;

@@ -109,19 +109,10 @@ const { type: from } = targetNode;

if (typeNode.Type === Syntax.Type && !!from && !!to) {
return {
...typeCastMaybe,
type: to,
value: targetNode.value,
Type: Syntax.TypeCast,
meta: { ...typeCastMaybe.meta, [TYPE_CAST]: { to, from } },
// We need to drop the typeNode here, because it's not something we can generate
params: [targetNode],
};
}
// If both sides of a pair don't have types then it's not a typecast,
// more likely a string: value pair in an object for example
return {
...typeCastMaybe,
params,
...typeCast,
type: to,
value: targetNode.value,
Type: Syntax.TypeCast,
meta: { ...typeCast.meta, [TYPE_CAST]: { to, from } },
// We need to drop the typeNode here, because it's not something we can generate
params: [targetNode],
};

@@ -149,3 +140,10 @@ },

[Syntax.TernaryExpression]: next => ([node, context]) => {
return next([balanceTypesInMathExpression(node), context]);
return next([
balanceTypesInMathExpression({
...node,
// Flatten out the parameters, put the condition node last
params: [...node.params[1].params, node.params[0]],
}),
context,
]);
},

@@ -152,0 +150,0 @@ };

@@ -47,2 +47,17 @@ /**

]);
case '-':
// Fold negation into a single opcode (a negative constant).
// The parser _currently_ generates 0 - <const> node pairs instead
if (rhs.Type === Syntax.Constant) {
return {
...rhs,
meta: {
...rhs.meta,
// Hint for generator
SIGN: -1,
},
};
}
// fallthrough
// eslint-disable-next-line
default:

@@ -49,0 +64,0 @@ return transform([

@@ -20,3 +20,3 @@ // @flow

code.forEach(({ kind, params, valueType, debug }) => {
code.forEach(({ kind, params, debug }) => {
invariant(

@@ -31,7 +31,2 @@ typeof kind !== 'undefined',

if (valueType) {
body.push(u8, valueType.type, 'result type');
body.push(u8, valueType.mutable, 'mutable');
}
// map over all params, if any and encode each on

@@ -38,0 +33,0 @@ params.filter(p => typeof p !== 'undefined').forEach(p => {

@@ -1,2 +0,7 @@

// @flow
/**
* This module contains all the general purpose mappings of Node Type to
* generator functions.
*
* @flow
*/
import generateFunctionCall from './function-call';

@@ -12,2 +17,3 @@ import generateIndirectFunctionCall from './indirect-function-call';

import generateAssignment from './assignment';
import generateAssignmentExpression from './assignment-expression';
import generateMemoryAssignment from './memory-assignment';

@@ -23,5 +29,6 @@ import generateLoop from './loop';

import generateAccess from './access';
import generateConstant from './constant';
import Syntax from 'walt-syntax';
import { getInScope, getConstOpcode } from './utils';
import { getInScope } from './utils';
import curry from 'curry';

@@ -36,3 +43,3 @@ import invariant from 'invariant';

// Unary
[Syntax.Constant]: getConstOpcode,
[Syntax.Constant]: generateConstant,
[Syntax.BinaryExpression]: generateBinaryExpression,

@@ -52,2 +59,3 @@ [Syntax.TernaryExpression]: generateTernary,

[Syntax.Assignment]: generateAssignment,
[Syntax.AssignmentExpression]: generateAssignmentExpression,
// Memory

@@ -68,3 +76,3 @@ [Syntax.MemoryAssignment]: generateMemoryAssignment,

mapping,
`Unexpected Syntax Token. ${operand.Type} "${operand.value}"`
`Unsupported Syntax Token. ${operand.Type} "${operand.value}"`
);

@@ -71,0 +79,0 @@

// @flow
import mapSyntax from './map-syntax';
import { generateValueType } from './utils';
import mergeBlock from './merge-block';
import opcode, { opcodeFromOperator } from '../emitter/opcode';
import opcode from '../emitter/opcode';
import type { GeneratorType } from './flow/types';
const generateTernary: GeneratorType = (node, parent) => {
// TernaryExpression has a simple param layout of 2(TWO) total parameters.
// It's a single param for the boolean check followed by
// another param which is a Pair Node containing the 2(TWO) param results of
// true and false branches.
// The whole thing is encoded as an implicitly returned if/then/else block.
const mapper = mapSyntax(parent);
const resultPair = node.params[1];
// Truthy check
const block = node.params
.slice(0, 1)
.map(mapper)
.reduce(mergeBlock, []);
// If Opcode
// TernaryExpression has a param layout of 3(TWO) total parameters.
// [truthy, falsy, condition]
// The whole thing is encoded as an Select opcode
//
// NOTE: The use of select means both "branches" are evaluated, even if not selected
const block = node.params.map(mapSyntax(parent)).reduce(mergeBlock, []);
block.push({
kind: opcodeFromOperator(node),
valueType: generateValueType(node),
kind: opcode.Select,
params: [],
});
// Map the true branch
block.push.apply(
block,
resultPair.params
.slice(0, 1)
.map(mapper)
.reduce(mergeBlock, [])
);
block.push({
kind: opcodeFromOperator({ value: ':', type: 'i32' }),
params: [],
});
// Map the false branch
block.push.apply(
block,
resultPair.params
.slice(-1)
.map(mapper)
.reduce(mergeBlock, [])
);
// Wrap up the node
block.push({ kind: opcode.End, params: [] });
return block;

@@ -56,0 +20,0 @@ };

@@ -8,7 +8,3 @@ // @flow

import { LOCAL_INDEX, GLOBAL_INDEX, TYPE_CONST } from '../semantics/metadata';
import type {
IntermediateVariableType,
IntermediateOpcodeType,
RawOpcodeType,
} from './flow/types';
import type { IntermediateVariableType } from './flow/types';
import type { NodeType } from '../flow/types';

@@ -38,16 +34,2 @@

export const getConstOpcode = (node: NodeType): IntermediateOpcodeType[] => {
const nodeType = node.type || builtinTypes.i32;
const kind: RawOpcodeType = opcode[nodeType + 'Const'];
const params = [Number(node.value)];
return [
{
kind,
params,
},
];
};
// clean this up

@@ -54,0 +36,0 @@ export const getType = (str: ?string): number => {

@@ -33,3 +33,3 @@ // @flow

};
export const VERSION = '0.18.0';
export const VERSION = '0.19.0';

@@ -124,2 +124,3 @@ // Used for debugging purposes

return {
wasm,
buffer() {

@@ -126,0 +127,0 @@ return wasm.buffer();

@@ -30,267 +30,1 @@ # Snapshot report for `src/parser/__tests__/type-spec.js`

}
## type parsing
> Snapshot 1
`00000000: 6d736100 ; \\0asm␊
00000004: 1 ; version 1␊
00000008: 1 ; Types section␊
00000009: 17 ; size␊
0000000a: 5 ; count␊
0000000b: 60 ; func type (0)␊
0000000c: 0 ; parameter count␊
0000000d: 0 ; result count␊
0000000e: 60 ; func type (1)␊
0000000f: 0 ; parameter count␊
00000010: 1 ; result count␊
00000011: 7f ; result type i32␊
00000012: 60 ; func type (2)␊
00000013: 1 ; parameter count␊
00000014: 7f ; param␊
00000015: 0 ; result count␊
00000016: 60 ; func type (3)␊
00000017: 2 ; parameter count␊
00000018: 7f ; param␊
00000019: 7f ; param␊
0000001a: 0 ; result count␊
0000001b: 60 ; func type (4)␊
0000001c: 2 ; parameter count␊
0000001d: 7f ; param␊
0000001e: 7f ; param␊
0000001f: 1 ; result count␊
00000020: 7f ; result type i32␊
00000021: 3 ; Functions section␊
00000022: 6 ; size␊
00000023: 5 ; count␊
00000024: 0 ; type index␊
00000025: 1 ; type index␊
00000026: 2 ; type index␊
00000027: 3 ; type index␊
00000028: 4 ; type index␊
00000029: 7 ; Exports section␊
0000002a: 3e ; size␊
0000002b: 5 ; count␊
0000002c: 7 ; field␊
0000002d: 6e ; n␊
0000002e: 6f ; o␊
0000002f: 74 ; t␊
00000030: 68 ; h␊
00000031: 69 ; i␊
00000032: 6e ; n␊
00000033: 67 ; g␊
00000034: 0 ; Global␊
00000035: 0 ; index␊
00000036: b ; field␊
00000037: 6e ; n␊
00000038: 6f ; o␊
00000039: 70 ; p␊
0000003a: 61 ; a␊
0000003b: 72 ; r␊
0000003c: 61 ; a␊
0000003d: 6d ; m␊
0000003e: 73 ; s␊
0000003f: 69 ; i␊
00000040: 33 ; 3␊
00000041: 32 ; 2␊
00000042: 0 ; Global␊
00000043: 1 ; index␊
00000044: 7 ; field␊
00000045: 69 ; i␊
00000046: 33 ; 3␊
00000047: 32 ; 2␊
00000048: 76 ; v␊
00000049: 6f ; o␊
0000004a: 69 ; i␊
0000004b: 64 ; d␊
0000004c: 0 ; Global␊
0000004d: 2 ; index␊
0000004e: 6 ; field␊
0000004f: 69 ; i␊
00000050: 33 ; 3␊
00000051: 32 ; 2␊
00000052: 69 ; i␊
00000053: 33 ; 3␊
00000054: 32 ; 2␊
00000055: 0 ; Global␊
00000056: 3 ; index␊
00000057: f ; field␊
00000058: 69 ; i␊
00000059: 33 ; 3␊
0000005a: 32 ; 2␊
0000005b: 69 ; i␊
0000005c: 33 ; 3␊
0000005d: 32 ; 2␊
0000005e: 72 ; r␊
0000005f: 65 ; e␊
00000060: 73 ; s␊
00000061: 75 ; u␊
00000062: 6c ; l␊
00000063: 74 ; t␊
00000064: 69 ; i␊
00000065: 33 ; 3␊
00000066: 32 ; 2␊
00000067: 0 ; Global␊
00000068: 4 ; index␊
00000069: a ; Code section␊
0000006a: 16 ; size␊
0000006b: 5 ; function count␊
0000006c: 2 ; Function nothing␊
0000006d: 0 ; locals count␊
0000006e: b ; end␊
0000006f: 5 ; Function noparamsi32␊
00000070: 0 ; locals count␊
00000071: 41 ; i32.const ␊
00000072: 2 ; i32.literal␊
00000073: f ; return ␊
00000074: b ; end␊
00000075: 2 ; Function i32void␊
00000076: 0 ; locals count␊
00000077: b ; end␊
00000078: 2 ; Function i32i32␊
00000079: 0 ; locals count␊
0000007a: b ; end␊
0000007b: 5 ; Function i32i32resulti32␊
0000007c: 0 ; locals count␊
0000007d: 41 ; i32.const ␊
0000007e: 2 ; i32.literal␊
0000007f: f ; return ␊
00000080: b ; end␊
============ fin =============`
> Snapshot 2
`00000000: 6d736100 ; \\0asm␊
00000004: 1 ; version 1␊
00000008: 1 ; Types section␊
00000009: 17 ; size␊
0000000a: 5 ; count␊
0000000b: 60 ; func type (0)␊
0000000c: 0 ; parameter count␊
0000000d: 0 ; result count␊
0000000e: 60 ; func type (1)␊
0000000f: 0 ; parameter count␊
00000010: 1 ; result count␊
00000011: 7f ; result type i32␊
00000012: 60 ; func type (2)␊
00000013: 1 ; parameter count␊
00000014: 7f ; param␊
00000015: 0 ; result count␊
00000016: 60 ; func type (3)␊
00000017: 2 ; parameter count␊
00000018: 7f ; param␊
00000019: 7f ; param␊
0000001a: 0 ; result count␊
0000001b: 60 ; func type (4)␊
0000001c: 2 ; parameter count␊
0000001d: 7f ; param␊
0000001e: 7f ; param␊
0000001f: 1 ; result count␊
00000020: 7f ; result type i32␊
00000021: 2 ; Imports section␊
00000022: 52 ; size␊
00000023: 5 ; entry count␊
00000024: 3 ; module␊
00000025: 65 ; e␊
00000026: 6e ; n␊
00000027: 76 ; v␊
00000028: 7 ; field␊
00000029: 6e ; n␊
0000002a: 6f ; o␊
0000002b: 74 ; t␊
0000002c: 68 ; h␊
0000002d: 69 ; i␊
0000002e: 6e ; n␊
0000002f: 67 ; g␊
00000030: 0 ; Function␊
00000031: 0 ; type index␊
00000032: 3 ; module␊
00000033: 65 ; e␊
00000034: 6e ; n␊
00000035: 76 ; v␊
00000036: b ; field␊
00000037: 6e ; n␊
00000038: 6f ; o␊
00000039: 70 ; p␊
0000003a: 61 ; a␊
0000003b: 72 ; r␊
0000003c: 61 ; a␊
0000003d: 6d ; m␊
0000003e: 73 ; s␊
0000003f: 69 ; i␊
00000040: 33 ; 3␊
00000041: 32 ; 2␊
00000042: 0 ; Function␊
00000043: 1 ; type index␊
00000044: 3 ; module␊
00000045: 65 ; e␊
00000046: 6e ; n␊
00000047: 76 ; v␊
00000048: 7 ; field␊
00000049: 69 ; i␊
0000004a: 33 ; 3␊
0000004b: 32 ; 2␊
0000004c: 76 ; v␊
0000004d: 6f ; o␊
0000004e: 69 ; i␊
0000004f: 64 ; d␊
00000050: 0 ; Function␊
00000051: 2 ; type index␊
00000052: 3 ; module␊
00000053: 65 ; e␊
00000054: 6e ; n␊
00000055: 76 ; v␊
00000056: 6 ; field␊
00000057: 69 ; i␊
00000058: 33 ; 3␊
00000059: 32 ; 2␊
0000005a: 69 ; i␊
0000005b: 33 ; 3␊
0000005c: 32 ; 2␊
0000005d: 0 ; Function␊
0000005e: 3 ; type index␊
0000005f: 3 ; module␊
00000060: 65 ; e␊
00000061: 6e ; n␊
00000062: 76 ; v␊
00000063: f ; field␊
00000064: 69 ; i␊
00000065: 33 ; 3␊
00000066: 32 ; 2␊
00000067: 69 ; i␊
00000068: 33 ; 3␊
00000069: 32 ; 2␊
0000006a: 72 ; r␊
0000006b: 65 ; e␊
0000006c: 73 ; s␊
0000006d: 75 ; u␊
0000006e: 6c ; l␊
0000006f: 74 ; t␊
00000070: 69 ; i␊
00000071: 33 ; 3␊
00000072: 32 ; 2␊
00000073: 0 ; Function␊
00000074: 4 ; type index␊
00000075: 3 ; Functions section␊
00000076: 2 ; size␊
00000077: 1 ; count␊
00000078: 1 ; type index␊
00000079: 7 ; Exports section␊
0000007a: 7 ; size␊
0000007b: 1 ; count␊
0000007c: 3 ; field␊
0000007d: 72 ; r␊
0000007e: 75 ; u␊
0000007f: 6e ; n␊
00000080: 0 ; Global␊
00000081: 5 ; index␊
00000082: a ; Code section␊
00000083: 7 ; size␊
00000084: 1 ; function count␊
00000085: 5 ; Function run␊
00000086: 0 ; locals count␊
00000087: 10 ; call noparamsi32<i32>␊
00000088: 1 ; i32.literal␊
00000089: f ; return ␊
0000008a: b ; end␊
============ fin =============`
import test from 'ava';
import { compile, debug, getIR } from '../..';
import { compile, getIR } from '../..';

@@ -44,6 +44,2 @@ // Passing in other WASM functions as ENV imports to another module causes

// snapshot both
t.snapshot(debug(importWASM));
t.snapshot(debug(sourceWASM));
t.is(run(), 2);

@@ -50,0 +46,0 @@ });

@@ -277,2 +277,14 @@ // Node Types

},
assignmentExpr(d, value) {
if (['-=', '+='].includes(value)) {
const operator = value[0];
const [target, amount] = drop(d);
const b = binary([target, { value: operator }, amount]);
return node(Syntax.AssignmentExpression, {
value: '=',
})([target, b]);
}
return node(Syntax.AssignmentExpression, { value })(d);
},
forLoop(d) {

@@ -279,0 +291,0 @@ const [initializer, condition, afterthought, ...body] = drop(d);

@@ -90,5 +90,5 @@ import { makeFragment } from '../../parser/fragment';

const ast = fragment('x + 2');
const binaryExpression = fragment('(x + 2)');
const node = map(parsers)([ast]);
const node = map(parsers)([binaryExpression]);

@@ -120,6 +120,6 @@ t.deepEqual(

const ast = fragment('x + 2');
const binaryExpression = fragment('(x + 2)');
const parsers = combineParsers([plugin].map(p => p().semantics()));
t.throws(() => map(parsers)([ast]));
t.throws(() => map(parsers)([binaryExpression]));
});

@@ -126,0 +126,0 @@

@@ -6,3 +6,3 @@ // @flow

export const PREFIX = 'operator/prefix';
export const LOCAL_INDEX = 'local/index';
export const LOCAL_INDEX = 'LOCAL_INDEX';
export const GLOBAL_INDEX = 'global/index';

@@ -9,0 +9,0 @@ export const TABLE_INDEX = 'table/index';

@@ -11,48 +11,48 @@ # Snapshot report for `src/utils/__tests__/debug-spec.js`

`00000000: 6d736100 ; \\0asm␊
00000004: 1 ; version 1␊
00000008: 1 ; Types section␊
00000009: 5 ; size␊
0000000a: 1 ; count␊
0000000b: 60 ; func type (0)␊
0000000c: 0 ; parameter count␊
0000000d: 1 ; result count␊
0000000e: 7f ; result type i32␊
0000000f: 3 ; Functions section␊
00000010: 2 ; size␊
00000011: 1 ; count␊
00000012: 0 ; type index␊
00000013: 6 ; Globals section␊
00000014: 6 ; size␊
00000015: 1 ; count␊
00000016: 7f ; i32␊
00000017: 0 ; mutable␊
00000018: 41 ; i32.const␊
00000019: 2 ; value (2)␊
0000001a: b ; end␊
0000001b: 7 ; Exports section␊
0000001c: 8 ; size␊
0000001d: 1 ; count␊
0000001e: 4 ; field␊
0000001f: 65 ; e␊
00000020: 63 ; c␊
00000021: 68 ; h␊
00000022: 6f ; o␊
00000023: 0 ; Global␊
00000024: 0 ; index␊
00000025: a ; Code section␊
00000026: d ; size␊
00000027: 1 ; function count␊
00000028: b ; Function echo␊
00000029: 1 ; locals count␊
0000002a: 1 ; number of locals of following type␊
0000002b: 7f ; i32␊
0000002c: 41 ; i32.const ␊
0000002d: 2a ; i32.literal␊
0000002e: 21 ; set_local x<i32>␊
0000002f: 0 ; i32.literal␊
00000030: 20 ; get_local x<i32>␊
00000031: 0 ; i32.literal␊
00000032: f ; return ␊
00000033: b ; end␊
` 0 0x0: 6d736100 ; \\0asm␊
4 0x4: 1 ; version 1␊
8 0x8: 1 ; Types section␊
9 0x9: 5 ; size␊
10 0xa: 1 ; count␊
11 0xb: 60 ; func type (0)␊
12 0xc: 0 ; parameter count␊
13 0xd: 1 ; result count␊
14 0xe: 7f ; result type i32␊
15 0xf: 3 ; Functions section␊
16 0x10: 2 ; size␊
17 0x11: 1 ; count␊
18 0x12: 0 ; type index␊
19 0x13: 6 ; Globals section␊
20 0x14: 6 ; size␊
21 0x15: 1 ; count␊
22 0x16: 7f ; i32␊
23 0x17: 0 ; mutable␊
24 0x18: 41 ; i32.const␊
25 0x19: 2 ; value (2)␊
26 0x1a: b ; end␊
27 0x1b: 7 ; Exports section␊
28 0x1c: 8 ; size␊
29 0x1d: 1 ; count␊
30 0x1e: 4 ; field␊
31 0x1f: 65 ; e␊
32 0x20: 63 ; c␊
33 0x21: 68 ; h␊
34 0x22: 6f ; o␊
35 0x23: 0 ; Global␊
36 0x24: 0 ; index␊
37 0x25: a ; Code section␊
38 0x26: d ; size␊
39 0x27: 1 ; function count␊
40 0x28: b ; Function echo␊
41 0x29: 1 ; locals count␊
42 0x2a: 1 ; number of locals of following type␊
43 0x2b: 7f ; i32␊
44 0x2c: 41 ; i32.const ␊
45 0x2d: 2a ; i32.literal␊
46 0x2e: 21 ; set_local x<i32>␊
47 0x2f: 0 ; i32.literal␊
48 0x30: 20 ; get_local x<i32>␊
49 0x31: 0 ; i32.literal␊
50 0x32: f ; return ␊
51 0x33: b ; end␊
============ fin =============`
import test from 'ava';
import debug from '../debug';
import { getIR } from '../..';
import { compile } from '../..';

@@ -12,3 +12,4 @@ const DEFAULT_EXAMPLE = `const x: i32 = 2;

test('debug prints web-assembly opcodes', t => {
t.snapshot(debug(getIR(DEFAULT_EXAMPLE)));
// TODO: Change the input to debug to be a static value instead
t.snapshot(debug(compile(DEFAULT_EXAMPLE).wasm));
});

@@ -11,5 +11,4 @@ // @flow

.map(({ type, value, debug }) => {
const pcString = pc
.toString(16)
.padStart(8, '0')
const pcString = `${pc.toString()} 0x${pc.toString(16)}`
.padStart(6, ' ')
.padEnd(stream.data.length.toString().length + 1);

@@ -16,0 +15,0 @@ let valueString;

@@ -188,5 +188,6 @@ /* istanbul ignore file */

[Syntax.TernaryExpression]: (node, print) => {
const [condition, options] = node.params;
const [lhs, rhs, condition] = node.params;
add('(select', 2);
print(options);
print(lhs);
print(rhs);
print(condition);

@@ -193,0 +194,0 @@ add(')', 0, -2);

@@ -14,7 +14,14 @@ import buildTools from 'walt-buildtools';

export const compileAndRun = (src, imports) =>
WebAssembly.instantiate(
compile(src, { encodeNames: true }).buffer(),
imports
);
export const compileAndRun = (
src,
imports,
options = { encodeNames: true }
) => {
const output = compile(src, options);
if (options.debug) {
// eslint-disable-next-line
console.log(debug(output.wasm));
}
return WebAssembly.instantiate(output.buffer(), imports);
};

@@ -21,0 +28,0 @@ function resolve(file, parent) {

@@ -153,2 +153,17 @@ # Snapshot report for `src/validation/__tests__/validation-spec.js`

## invalid sucbscript target
> Snapshot 1
Error {
message: `Cannot generate WebAssembly for spec.walt. 1 problems.␊
v += a[i];␊
^ Expected array type for a, received i32␊
Invalid subscript target␊
at fn() (spec.walt:11:12)␊
`,
}
## typos throw

@@ -296,17 +311,2 @@

`,
## invalid sucbscript target
> Snapshot 1
Error {
message: `Cannot generate WebAssembly for spec.walt. 1 problems.␊
v += a[i];␊
^ Expected array type for a, received i32␊
Invalid subscript target␊
at fn() (spec.walt:11:12)␊
`,
}
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc