unwasm 0.3.8 → 0.3.10
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/README.md +8 -5
- package/dist/plugin.cjs +101 -70
- package/dist/plugin.d.cts +5 -2
- package/dist/plugin.d.mts +3 -2
- package/dist/plugin.d.ts +5 -2
- package/dist/plugin.mjs +101 -70
- package/dist/tools.cjs +387 -346
- package/dist/tools.d.cts +2 -1
- package/dist/tools.d.mts +2 -1
- package/dist/tools.d.ts +2 -1
- package/dist/tools.mjs +387 -346
- package/package.json +35 -29
package/dist/tools.cjs
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
// webassemblyjs (MIT) - Copyright (c) 2018 Sven Sauleau <sven@sauleau.com>
|
|
4
|
-
|
|
5
3
|
var __create = Object.create;
|
|
6
4
|
var __defProp = Object.defineProperty;
|
|
7
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -24,13 +22,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
22
|
// file that has been converted to a CommonJS file using a Babel-
|
|
25
23
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
24
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
-
|
|
25
|
+
__defProp(target, "default", { value: mod, enumerable: true }) ,
|
|
28
26
|
mod
|
|
29
27
|
));
|
|
30
|
-
|
|
31
|
-
// node_modules/.pnpm/@webassemblyjs+helper-api-error@1.11.6/node_modules/@webassemblyjs/helper-api-error/lib/index.js
|
|
32
28
|
var require_lib = __commonJS({
|
|
33
|
-
"node_modules/.pnpm/@webassemblyjs+helper-api-error@1.
|
|
29
|
+
"node_modules/.pnpm/@webassemblyjs+helper-api-error@1.13.2/node_modules/@webassemblyjs/helper-api-error/lib/index.js"(exports) {
|
|
34
30
|
function _typeof(obj) {
|
|
35
31
|
"@babel/helpers - typeof";
|
|
36
32
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
@@ -58,8 +54,7 @@ var require_lib = __commonJS({
|
|
|
58
54
|
throw new TypeError("Super expression must either be null or a function");
|
|
59
55
|
}
|
|
60
56
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
61
|
-
if (superClass)
|
|
62
|
-
_setPrototypeOf(subClass, superClass);
|
|
57
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
63
58
|
}
|
|
64
59
|
function _createSuper(Derived) {
|
|
65
60
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
@@ -91,14 +86,12 @@ var require_lib = __commonJS({
|
|
|
91
86
|
function _wrapNativeSuper(Class) {
|
|
92
87
|
var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
93
88
|
_wrapNativeSuper = function _wrapNativeSuper2(Class2) {
|
|
94
|
-
if (Class2 === null || !_isNativeFunction(Class2))
|
|
95
|
-
return Class2;
|
|
89
|
+
if (Class2 === null || !_isNativeFunction(Class2)) return Class2;
|
|
96
90
|
if (typeof Class2 !== "function") {
|
|
97
91
|
throw new TypeError("Super expression must either be null or a function");
|
|
98
92
|
}
|
|
99
93
|
if (typeof _cache !== "undefined") {
|
|
100
|
-
if (_cache.has(Class2))
|
|
101
|
-
return _cache.get(Class2);
|
|
94
|
+
if (_cache.has(Class2)) return _cache.get(Class2);
|
|
102
95
|
_cache.set(Class2, Wrapper);
|
|
103
96
|
}
|
|
104
97
|
function Wrapper() {
|
|
@@ -118,20 +111,16 @@ var require_lib = __commonJS({
|
|
|
118
111
|
a.push.apply(a, args2);
|
|
119
112
|
var Constructor = Function.bind.apply(Parent2, a);
|
|
120
113
|
var instance = new Constructor();
|
|
121
|
-
if (Class2)
|
|
122
|
-
_setPrototypeOf(instance, Class2.prototype);
|
|
114
|
+
if (Class2) _setPrototypeOf(instance, Class2.prototype);
|
|
123
115
|
return instance;
|
|
124
116
|
};
|
|
125
117
|
}
|
|
126
118
|
return _construct.apply(null, arguments);
|
|
127
119
|
}
|
|
128
120
|
function _isNativeReflectConstruct() {
|
|
129
|
-
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
130
|
-
|
|
131
|
-
if (
|
|
132
|
-
return false;
|
|
133
|
-
if (typeof Proxy === "function")
|
|
134
|
-
return true;
|
|
121
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
122
|
+
if (Reflect.construct.sham) return false;
|
|
123
|
+
if (typeof Proxy === "function") return true;
|
|
135
124
|
try {
|
|
136
125
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
137
126
|
}));
|
|
@@ -156,7 +145,7 @@ var require_lib = __commonJS({
|
|
|
156
145
|
};
|
|
157
146
|
return _getPrototypeOf(o);
|
|
158
147
|
}
|
|
159
|
-
var RuntimeError = /* @__PURE__ */ function(_Error) {
|
|
148
|
+
var RuntimeError = /* @__PURE__ */ (function(_Error) {
|
|
160
149
|
_inherits(RuntimeError2, _Error);
|
|
161
150
|
var _super = _createSuper(RuntimeError2);
|
|
162
151
|
function RuntimeError2() {
|
|
@@ -164,9 +153,9 @@ var require_lib = __commonJS({
|
|
|
164
153
|
return _super.apply(this, arguments);
|
|
165
154
|
}
|
|
166
155
|
return RuntimeError2;
|
|
167
|
-
}(/* @__PURE__ */ _wrapNativeSuper(Error));
|
|
156
|
+
})(/* @__PURE__ */ _wrapNativeSuper(Error));
|
|
168
157
|
exports.RuntimeError = RuntimeError;
|
|
169
|
-
var CompileError = /* @__PURE__ */ function(_Error2) {
|
|
158
|
+
var CompileError = /* @__PURE__ */ (function(_Error2) {
|
|
170
159
|
_inherits(CompileError2, _Error2);
|
|
171
160
|
var _super2 = _createSuper(CompileError2);
|
|
172
161
|
function CompileError2() {
|
|
@@ -174,9 +163,9 @@ var require_lib = __commonJS({
|
|
|
174
163
|
return _super2.apply(this, arguments);
|
|
175
164
|
}
|
|
176
165
|
return CompileError2;
|
|
177
|
-
}(/* @__PURE__ */ _wrapNativeSuper(Error));
|
|
166
|
+
})(/* @__PURE__ */ _wrapNativeSuper(Error));
|
|
178
167
|
exports.CompileError = CompileError;
|
|
179
|
-
var LinkError = /* @__PURE__ */ function(_Error3) {
|
|
168
|
+
var LinkError = /* @__PURE__ */ (function(_Error3) {
|
|
180
169
|
_inherits(LinkError2, _Error3);
|
|
181
170
|
var _super3 = _createSuper(LinkError2);
|
|
182
171
|
function LinkError2() {
|
|
@@ -184,12 +173,10 @@ var require_lib = __commonJS({
|
|
|
184
173
|
return _super3.apply(this, arguments);
|
|
185
174
|
}
|
|
186
175
|
return LinkError2;
|
|
187
|
-
}(/* @__PURE__ */ _wrapNativeSuper(Error));
|
|
176
|
+
})(/* @__PURE__ */ _wrapNativeSuper(Error));
|
|
188
177
|
exports.LinkError = LinkError;
|
|
189
178
|
}
|
|
190
179
|
});
|
|
191
|
-
|
|
192
|
-
// node_modules/.pnpm/@xtuc+ieee754@1.2.0/node_modules/@xtuc/ieee754/dist/index.cjs.js
|
|
193
180
|
var require_index_cjs = __commonJS({
|
|
194
181
|
"node_modules/.pnpm/@xtuc+ieee754@1.2.0/node_modules/@xtuc/ieee754/dist/index.cjs.js"(exports) {
|
|
195
182
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -276,10 +263,8 @@ var require_index_cjs = __commonJS({
|
|
|
276
263
|
}
|
|
277
264
|
}
|
|
278
265
|
});
|
|
279
|
-
|
|
280
|
-
// node_modules/.pnpm/@webassemblyjs+ieee754@1.11.6/node_modules/@webassemblyjs/ieee754/lib/index.js
|
|
281
266
|
var require_lib2 = __commonJS({
|
|
282
|
-
"node_modules/.pnpm/@webassemblyjs+ieee754@1.
|
|
267
|
+
"node_modules/.pnpm/@webassemblyjs+ieee754@1.14.1/node_modules/@webassemblyjs/ieee754/lib/index.js"(exports) {
|
|
283
268
|
Object.defineProperty(exports, "__esModule", {
|
|
284
269
|
value: true
|
|
285
270
|
});
|
|
@@ -308,19 +293,17 @@ var require_lib2 = __commonJS({
|
|
|
308
293
|
return buffer;
|
|
309
294
|
}
|
|
310
295
|
function decodeF32(bytes) {
|
|
311
|
-
var buffer =
|
|
296
|
+
var buffer = new Uint8Array(bytes);
|
|
312
297
|
return (0, _ieee.read)(buffer, 0, true, SINGLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F32);
|
|
313
298
|
}
|
|
314
299
|
function decodeF64(bytes) {
|
|
315
|
-
var buffer =
|
|
300
|
+
var buffer = new Uint8Array(bytes);
|
|
316
301
|
return (0, _ieee.read)(buffer, 0, true, DOUBLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F64);
|
|
317
302
|
}
|
|
318
303
|
}
|
|
319
304
|
});
|
|
320
|
-
|
|
321
|
-
// node_modules/.pnpm/@webassemblyjs+utf8@1.11.6/node_modules/@webassemblyjs/utf8/lib/decoder.js
|
|
322
305
|
var require_decoder = __commonJS({
|
|
323
|
-
"node_modules/.pnpm/@webassemblyjs+utf8@1.
|
|
306
|
+
"node_modules/.pnpm/@webassemblyjs+utf8@1.14.1/node_modules/@webassemblyjs/utf8/lib/decoder.js"(exports) {
|
|
324
307
|
Object.defineProperty(exports, "__esModule", {
|
|
325
308
|
value: true
|
|
326
309
|
});
|
|
@@ -380,10 +363,8 @@ var require_decoder = __commonJS({
|
|
|
380
363
|
}
|
|
381
364
|
}
|
|
382
365
|
});
|
|
383
|
-
|
|
384
|
-
// node_modules/.pnpm/@webassemblyjs+utf8@1.11.6/node_modules/@webassemblyjs/utf8/lib/encoder.js
|
|
385
366
|
var require_encoder = __commonJS({
|
|
386
|
-
"node_modules/.pnpm/@webassemblyjs+utf8@1.
|
|
367
|
+
"node_modules/.pnpm/@webassemblyjs+utf8@1.14.1/node_modules/@webassemblyjs/utf8/lib/encoder.js"(exports) {
|
|
387
368
|
Object.defineProperty(exports, "__esModule", {
|
|
388
369
|
value: true
|
|
389
370
|
});
|
|
@@ -395,8 +376,7 @@ var require_encoder = __commonJS({
|
|
|
395
376
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
396
377
|
}
|
|
397
378
|
function _arrayWithoutHoles(arr) {
|
|
398
|
-
if (Array.isArray(arr))
|
|
399
|
-
return _arrayLikeToArray(arr);
|
|
379
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
400
380
|
}
|
|
401
381
|
function _toArray(arr) {
|
|
402
382
|
return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
|
|
@@ -405,33 +385,25 @@ var require_encoder = __commonJS({
|
|
|
405
385
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
406
386
|
}
|
|
407
387
|
function _unsupportedIterableToArray(o, minLen) {
|
|
408
|
-
if (!o)
|
|
409
|
-
|
|
410
|
-
if (typeof o === "string")
|
|
411
|
-
return _arrayLikeToArray(o, minLen);
|
|
388
|
+
if (!o) return;
|
|
389
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
412
390
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
413
|
-
if (n === "Object" && o.constructor)
|
|
414
|
-
|
|
415
|
-
if (n === "
|
|
416
|
-
return Array.from(o);
|
|
417
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
418
|
-
return _arrayLikeToArray(o, minLen);
|
|
391
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
392
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
393
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
419
394
|
}
|
|
420
395
|
function _arrayLikeToArray(arr, len) {
|
|
421
|
-
if (len == null || len > arr.length)
|
|
422
|
-
len = arr.length;
|
|
396
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
423
397
|
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
424
398
|
arr2[i] = arr[i];
|
|
425
399
|
}
|
|
426
400
|
return arr2;
|
|
427
401
|
}
|
|
428
402
|
function _iterableToArray(iter) {
|
|
429
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
430
|
-
return Array.from(iter);
|
|
403
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
431
404
|
}
|
|
432
405
|
function _arrayWithHoles(arr) {
|
|
433
|
-
if (Array.isArray(arr))
|
|
434
|
-
return arr;
|
|
406
|
+
if (Array.isArray(arr)) return arr;
|
|
435
407
|
}
|
|
436
408
|
function con(n) {
|
|
437
409
|
return 128 | n & 63;
|
|
@@ -466,10 +438,8 @@ var require_encoder = __commonJS({
|
|
|
466
438
|
}
|
|
467
439
|
}
|
|
468
440
|
});
|
|
469
|
-
|
|
470
|
-
// node_modules/.pnpm/@webassemblyjs+utf8@1.11.6/node_modules/@webassemblyjs/utf8/lib/index.js
|
|
471
441
|
var require_lib3 = __commonJS({
|
|
472
|
-
"node_modules/.pnpm/@webassemblyjs+utf8@1.
|
|
442
|
+
"node_modules/.pnpm/@webassemblyjs+utf8@1.14.1/node_modules/@webassemblyjs/utf8/lib/index.js"(exports) {
|
|
473
443
|
Object.defineProperty(exports, "__esModule", {
|
|
474
444
|
value: true
|
|
475
445
|
});
|
|
@@ -489,10 +459,8 @@ var require_lib3 = __commonJS({
|
|
|
489
459
|
var _encoder = require_encoder();
|
|
490
460
|
}
|
|
491
461
|
});
|
|
492
|
-
|
|
493
|
-
// node_modules/.pnpm/@webassemblyjs+ast@1.12.1/node_modules/@webassemblyjs/ast/lib/nodes.js
|
|
494
462
|
var require_nodes = __commonJS({
|
|
495
|
-
"node_modules/.pnpm/@webassemblyjs+ast@1.
|
|
463
|
+
"node_modules/.pnpm/@webassemblyjs+ast@1.14.1/node_modules/@webassemblyjs/ast/lib/nodes.js"(exports) {
|
|
496
464
|
Object.defineProperty(exports, "__esModule", {
|
|
497
465
|
value: true
|
|
498
466
|
});
|
|
@@ -565,11 +533,11 @@ var require_nodes = __commonJS({
|
|
|
565
533
|
}
|
|
566
534
|
function assertTypeOf(t) {
|
|
567
535
|
return function(n) {
|
|
568
|
-
return function() {
|
|
536
|
+
return (function() {
|
|
569
537
|
if (!(n.type === t)) {
|
|
570
538
|
throw new Error("n.type === t error: unknown");
|
|
571
539
|
}
|
|
572
|
-
}();
|
|
540
|
+
})();
|
|
573
541
|
};
|
|
574
542
|
}
|
|
575
543
|
function _module(id, fields, metadata) {
|
|
@@ -1491,8 +1459,6 @@ var require_nodes = __commonJS({
|
|
|
1491
1459
|
exports.nodeAndUnionTypes = nodeAndUnionTypes;
|
|
1492
1460
|
}
|
|
1493
1461
|
});
|
|
1494
|
-
|
|
1495
|
-
// node_modules/.pnpm/@xtuc+long@4.2.2/node_modules/@xtuc/long/src/long.js
|
|
1496
1462
|
var require_long = __commonJS({
|
|
1497
1463
|
"node_modules/.pnpm/@xtuc+long@4.2.2/node_modules/@xtuc/long/src/long.js"(exports, module) {
|
|
1498
1464
|
module.exports = Long;
|
|
@@ -2278,26 +2244,19 @@ var require_long = __commonJS({
|
|
|
2278
2244
|
};
|
|
2279
2245
|
LongPrototype.shr = LongPrototype.shiftRight;
|
|
2280
2246
|
LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {
|
|
2281
|
-
if (isLong(numBits))
|
|
2282
|
-
|
|
2283
|
-
if (
|
|
2284
|
-
|
|
2285
|
-
if (numBits < 32)
|
|
2286
|
-
return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >>> numBits, this.unsigned);
|
|
2287
|
-
if (numBits === 32)
|
|
2288
|
-
return fromBits(this.high, 0, this.unsigned);
|
|
2247
|
+
if (isLong(numBits)) numBits = numBits.toInt();
|
|
2248
|
+
if ((numBits &= 63) === 0) return this;
|
|
2249
|
+
if (numBits < 32) return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >>> numBits, this.unsigned);
|
|
2250
|
+
if (numBits === 32) return fromBits(this.high, 0, this.unsigned);
|
|
2289
2251
|
return fromBits(this.high >>> numBits - 32, 0, this.unsigned);
|
|
2290
2252
|
};
|
|
2291
2253
|
LongPrototype.shru = LongPrototype.shiftRightUnsigned;
|
|
2292
2254
|
LongPrototype.shr_u = LongPrototype.shiftRightUnsigned;
|
|
2293
2255
|
LongPrototype.rotateLeft = function rotateLeft(numBits) {
|
|
2294
2256
|
var b;
|
|
2295
|
-
if (isLong(numBits))
|
|
2296
|
-
|
|
2297
|
-
if (
|
|
2298
|
-
return this;
|
|
2299
|
-
if (numBits === 32)
|
|
2300
|
-
return fromBits(this.high, this.low, this.unsigned);
|
|
2257
|
+
if (isLong(numBits)) numBits = numBits.toInt();
|
|
2258
|
+
if ((numBits &= 63) === 0) return this;
|
|
2259
|
+
if (numBits === 32) return fromBits(this.high, this.low, this.unsigned);
|
|
2301
2260
|
if (numBits < 32) {
|
|
2302
2261
|
b = 32 - numBits;
|
|
2303
2262
|
return fromBits(this.low << numBits | this.high >>> b, this.high << numBits | this.low >>> b, this.unsigned);
|
|
@@ -2309,12 +2268,9 @@ var require_long = __commonJS({
|
|
|
2309
2268
|
LongPrototype.rotl = LongPrototype.rotateLeft;
|
|
2310
2269
|
LongPrototype.rotateRight = function rotateRight(numBits) {
|
|
2311
2270
|
var b;
|
|
2312
|
-
if (isLong(numBits))
|
|
2313
|
-
|
|
2314
|
-
if (
|
|
2315
|
-
return this;
|
|
2316
|
-
if (numBits === 32)
|
|
2317
|
-
return fromBits(this.high, this.low, this.unsigned);
|
|
2271
|
+
if (isLong(numBits)) numBits = numBits.toInt();
|
|
2272
|
+
if ((numBits &= 63) === 0) return this;
|
|
2273
|
+
if (numBits === 32) return fromBits(this.high, this.low, this.unsigned);
|
|
2318
2274
|
if (numBits < 32) {
|
|
2319
2275
|
b = 32 - numBits;
|
|
2320
2276
|
return fromBits(this.high << b | this.low >>> numBits, this.low << b | this.high >>> numBits, this.unsigned);
|
|
@@ -2382,10 +2338,8 @@ var require_long = __commonJS({
|
|
|
2382
2338
|
};
|
|
2383
2339
|
}
|
|
2384
2340
|
});
|
|
2385
|
-
|
|
2386
|
-
// node_modules/.pnpm/@webassemblyjs+floating-point-hex-parser@1.11.6/node_modules/@webassemblyjs/floating-point-hex-parser/lib/index.js
|
|
2387
2341
|
var require_lib4 = __commonJS({
|
|
2388
|
-
"node_modules/.pnpm/@webassemblyjs+floating-point-hex-parser@1.
|
|
2342
|
+
"node_modules/.pnpm/@webassemblyjs+floating-point-hex-parser@1.13.2/node_modules/@webassemblyjs/floating-point-hex-parser/lib/index.js"(exports) {
|
|
2389
2343
|
Object.defineProperty(exports, "__esModule", {
|
|
2390
2344
|
value: true
|
|
2391
2345
|
});
|
|
@@ -2429,10 +2383,8 @@ var require_lib4 = __commonJS({
|
|
|
2429
2383
|
}
|
|
2430
2384
|
}
|
|
2431
2385
|
});
|
|
2432
|
-
|
|
2433
|
-
// node_modules/.pnpm/@webassemblyjs+helper-numbers@1.11.6/node_modules/@webassemblyjs/helper-numbers/lib/index.js
|
|
2434
2386
|
var require_lib5 = __commonJS({
|
|
2435
|
-
"node_modules/.pnpm/@webassemblyjs+helper-numbers@1.
|
|
2387
|
+
"node_modules/.pnpm/@webassemblyjs+helper-numbers@1.13.2/node_modules/@webassemblyjs/helper-numbers/lib/index.js"(exports) {
|
|
2436
2388
|
Object.defineProperty(exports, "__esModule", {
|
|
2437
2389
|
value: true
|
|
2438
2390
|
});
|
|
@@ -2524,10 +2476,8 @@ var require_lib5 = __commonJS({
|
|
|
2524
2476
|
}
|
|
2525
2477
|
}
|
|
2526
2478
|
});
|
|
2527
|
-
|
|
2528
|
-
// node_modules/.pnpm/@webassemblyjs+ast@1.12.1/node_modules/@webassemblyjs/ast/lib/node-helpers.js
|
|
2529
2479
|
var require_node_helpers = __commonJS({
|
|
2530
|
-
"node_modules/.pnpm/@webassemblyjs+ast@1.
|
|
2480
|
+
"node_modules/.pnpm/@webassemblyjs+ast@1.14.1/node_modules/@webassemblyjs/ast/lib/node-helpers.js"(exports) {
|
|
2531
2481
|
Object.defineProperty(exports, "__esModule", {
|
|
2532
2482
|
value: true
|
|
2533
2483
|
});
|
|
@@ -2563,6 +2513,7 @@ var require_node_helpers = __commonJS({
|
|
|
2563
2513
|
case "f32": {
|
|
2564
2514
|
return (0, _nodes.floatLiteral)((0, _helperNumbers.parse32F)(rawValue), (0, _helperNumbers.isNanLiteral)(rawValue), (0, _helperNumbers.isInfLiteral)(rawValue), String(original));
|
|
2565
2515
|
}
|
|
2516
|
+
// f64
|
|
2566
2517
|
default: {
|
|
2567
2518
|
return (0, _nodes.floatLiteral)((0, _helperNumbers.parse64F)(rawValue), (0, _helperNumbers.isNanLiteral)(rawValue), (0, _helperNumbers.isInfLiteral)(rawValue), String(original));
|
|
2568
2519
|
}
|
|
@@ -2607,10 +2558,8 @@ var require_node_helpers = __commonJS({
|
|
|
2607
2558
|
}
|
|
2608
2559
|
}
|
|
2609
2560
|
});
|
|
2610
|
-
|
|
2611
|
-
// node_modules/.pnpm/@webassemblyjs+ast@1.12.1/node_modules/@webassemblyjs/ast/lib/node-path.js
|
|
2612
2561
|
var require_node_path = __commonJS({
|
|
2613
|
-
"node_modules/.pnpm/@webassemblyjs+ast@1.
|
|
2562
|
+
"node_modules/.pnpm/@webassemblyjs+ast@1.14.1/node_modules/@webassemblyjs/ast/lib/node-path.js"(exports) {
|
|
2614
2563
|
Object.defineProperty(exports, "__esModule", {
|
|
2615
2564
|
value: true
|
|
2616
2565
|
});
|
|
@@ -2746,10 +2695,8 @@ var require_node_path = __commonJS({
|
|
|
2746
2695
|
}
|
|
2747
2696
|
}
|
|
2748
2697
|
});
|
|
2749
|
-
|
|
2750
|
-
// node_modules/.pnpm/@webassemblyjs+ast@1.12.1/node_modules/@webassemblyjs/ast/lib/traverse.js
|
|
2751
2698
|
var require_traverse = __commonJS({
|
|
2752
|
-
"node_modules/.pnpm/@webassemblyjs+ast@1.
|
|
2699
|
+
"node_modules/.pnpm/@webassemblyjs+ast@1.14.1/node_modules/@webassemblyjs/ast/lib/traverse.js"(exports) {
|
|
2753
2700
|
Object.defineProperty(exports, "__esModule", {
|
|
2754
2701
|
value: true
|
|
2755
2702
|
});
|
|
@@ -2836,10 +2783,8 @@ var require_traverse = __commonJS({
|
|
|
2836
2783
|
}
|
|
2837
2784
|
}
|
|
2838
2785
|
});
|
|
2839
|
-
|
|
2840
|
-
// node_modules/.pnpm/@webassemblyjs+ast@1.12.1/node_modules/@webassemblyjs/ast/lib/signatures.js
|
|
2841
2786
|
var require_signatures = __commonJS({
|
|
2842
|
-
"node_modules/.pnpm/@webassemblyjs+ast@1.
|
|
2787
|
+
"node_modules/.pnpm/@webassemblyjs+ast@1.14.1/node_modules/@webassemblyjs/ast/lib/signatures.js"(exports) {
|
|
2843
2788
|
Object.defineProperty(exports, "__esModule", {
|
|
2844
2789
|
value: true
|
|
2845
2790
|
});
|
|
@@ -3042,10 +2987,8 @@ var require_signatures = __commonJS({
|
|
|
3042
2987
|
exports.signatures = signatures;
|
|
3043
2988
|
}
|
|
3044
2989
|
});
|
|
3045
|
-
|
|
3046
|
-
// node_modules/.pnpm/@webassemblyjs+helper-wasm-bytecode@1.11.6/node_modules/@webassemblyjs/helper-wasm-bytecode/lib/section.js
|
|
3047
2990
|
var require_section = __commonJS({
|
|
3048
|
-
"node_modules/.pnpm/@webassemblyjs+helper-wasm-bytecode@1.
|
|
2991
|
+
"node_modules/.pnpm/@webassemblyjs+helper-wasm-bytecode@1.14.1/node_modules/@webassemblyjs/helper-wasm-bytecode/lib/section.js"(exports) {
|
|
3049
2992
|
Object.defineProperty(exports, "__esModule", {
|
|
3050
2993
|
value: true
|
|
3051
2994
|
});
|
|
@@ -3069,16 +3012,15 @@ var require_section = __commonJS({
|
|
|
3069
3012
|
return "func";
|
|
3070
3013
|
case "Global":
|
|
3071
3014
|
return "global";
|
|
3015
|
+
// No section
|
|
3072
3016
|
default:
|
|
3073
3017
|
return;
|
|
3074
3018
|
}
|
|
3075
3019
|
}
|
|
3076
3020
|
}
|
|
3077
3021
|
});
|
|
3078
|
-
|
|
3079
|
-
// node_modules/.pnpm/@webassemblyjs+helper-wasm-bytecode@1.11.6/node_modules/@webassemblyjs/helper-wasm-bytecode/lib/index.js
|
|
3080
3022
|
var require_lib6 = __commonJS({
|
|
3081
|
-
"node_modules/.pnpm/@webassemblyjs+helper-wasm-bytecode@1.
|
|
3023
|
+
"node_modules/.pnpm/@webassemblyjs+helper-wasm-bytecode@1.14.1/node_modules/@webassemblyjs/helper-wasm-bytecode/lib/index.js"(exports) {
|
|
3082
3024
|
Object.defineProperty(exports, "__esModule", {
|
|
3083
3025
|
value: true
|
|
3084
3026
|
});
|
|
@@ -3131,15 +3073,21 @@ var require_lib6 = __commonJS({
|
|
|
3131
3073
|
};
|
|
3132
3074
|
var exportTypesByName = invertMap(exportTypes);
|
|
3133
3075
|
var valtypes = {
|
|
3076
|
+
// numtype
|
|
3134
3077
|
127: "i32",
|
|
3135
3078
|
126: "i64",
|
|
3136
3079
|
125: "f32",
|
|
3137
3080
|
124: "f64",
|
|
3138
|
-
|
|
3081
|
+
// vectype
|
|
3082
|
+
123: "v128",
|
|
3083
|
+
// reftype
|
|
3084
|
+
112: "anyfunc",
|
|
3085
|
+
111: "externref"
|
|
3139
3086
|
};
|
|
3140
3087
|
var valtypesByString = invertMap(valtypes);
|
|
3141
3088
|
var tableTypes = {
|
|
3142
|
-
112: "anyfunc"
|
|
3089
|
+
112: "anyfunc",
|
|
3090
|
+
111: "externref"
|
|
3143
3091
|
};
|
|
3144
3092
|
var blockTypes = Object.assign({}, valtypes, {
|
|
3145
3093
|
// https://webassembly.github.io/spec/core/binary/types.html#binary-blocktype
|
|
@@ -3213,8 +3161,8 @@ var require_lib6 = __commonJS({
|
|
|
3213
3161
|
34: createSymbol("tee_local", 1),
|
|
3214
3162
|
35: createSymbol("get_global", 1),
|
|
3215
3163
|
36: createSymbol("set_global", 1),
|
|
3216
|
-
37:
|
|
3217
|
-
38:
|
|
3164
|
+
37: createSymbol("table.get", 1),
|
|
3165
|
+
38: createSymbol("table.set", 1),
|
|
3218
3166
|
39: illegalop,
|
|
3219
3167
|
40: createSymbolObject("load", "u32", 1),
|
|
3220
3168
|
41: createSymbolObject("load", "u64", 1),
|
|
@@ -3368,6 +3316,24 @@ var require_lib6 = __commonJS({
|
|
|
3368
3316
|
189: createSymbolObject("reinterpret/f64", "i64"),
|
|
3369
3317
|
190: createSymbolObject("reinterpret/i32", "f32"),
|
|
3370
3318
|
191: createSymbolObject("reinterpret/i64", "f64"),
|
|
3319
|
+
192: createSymbolObject("extend8_s", "i32"),
|
|
3320
|
+
193: createSymbolObject("extend16_s", "i32"),
|
|
3321
|
+
194: createSymbolObject("extend8_s", "i64"),
|
|
3322
|
+
195: createSymbolObject("extend16_s", "i64"),
|
|
3323
|
+
196: createSymbolObject("extend32_s", "i64"),
|
|
3324
|
+
208: createSymbol("ref.null"),
|
|
3325
|
+
209: createSymbol("ref.is_null"),
|
|
3326
|
+
210: createSymbol("ref.func", 1),
|
|
3327
|
+
64522: createSymbol("memory.copy"),
|
|
3328
|
+
64523: createSymbol("memory.fill"),
|
|
3329
|
+
// Table instructions
|
|
3330
|
+
// https://webassembly.github.io/spec/core/binary/instructions.html#table-instructions
|
|
3331
|
+
64524: createSymbol("table.init", 2),
|
|
3332
|
+
64525: createSymbol("elem.drop", 1),
|
|
3333
|
+
64526: createSymbol("table.copy", 2),
|
|
3334
|
+
64527: createSymbol("table.grow", 1),
|
|
3335
|
+
64528: createSymbol("table.size", 1),
|
|
3336
|
+
64529: createSymbol("table.fill", 1),
|
|
3371
3337
|
// Atomic Memory Instructions
|
|
3372
3338
|
65024: createSymbol("memory.atomic.notify", 1),
|
|
3373
3339
|
65025: createSymbol("memory.atomic.wait32", 1),
|
|
@@ -3462,10 +3428,8 @@ var require_lib6 = __commonJS({
|
|
|
3462
3428
|
exports["default"] = _default;
|
|
3463
3429
|
}
|
|
3464
3430
|
});
|
|
3465
|
-
|
|
3466
|
-
// node_modules/.pnpm/@webassemblyjs+ast@1.12.1/node_modules/@webassemblyjs/ast/lib/utils.js
|
|
3467
3431
|
var require_utils = __commonJS({
|
|
3468
|
-
"node_modules/.pnpm/@webassemblyjs+ast@1.
|
|
3432
|
+
"node_modules/.pnpm/@webassemblyjs+ast@1.14.1/node_modules/@webassemblyjs/ast/lib/utils.js"(exports) {
|
|
3469
3433
|
Object.defineProperty(exports, "__esModule", {
|
|
3470
3434
|
value: true
|
|
3471
3435
|
});
|
|
@@ -3489,8 +3453,7 @@ var require_utils = __commonJS({
|
|
|
3489
3453
|
var _traverse = require_traverse();
|
|
3490
3454
|
var _helperWasmBytecode = _interopRequireWildcard(require_lib6());
|
|
3491
3455
|
function _getRequireWildcardCache(nodeInterop) {
|
|
3492
|
-
if (typeof WeakMap !== "function")
|
|
3493
|
-
return null;
|
|
3456
|
+
if (typeof WeakMap !== "function") return null;
|
|
3494
3457
|
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
|
|
3495
3458
|
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
|
3496
3459
|
return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
|
|
@@ -3498,7 +3461,7 @@ var require_utils = __commonJS({
|
|
|
3498
3461
|
})(nodeInterop);
|
|
3499
3462
|
}
|
|
3500
3463
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
3501
|
-
if (
|
|
3464
|
+
if (obj && obj.__esModule) {
|
|
3502
3465
|
return obj;
|
|
3503
3466
|
}
|
|
3504
3467
|
if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
|
|
@@ -3533,21 +3496,15 @@ var require_utils = __commonJS({
|
|
|
3533
3496
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3534
3497
|
}
|
|
3535
3498
|
function _unsupportedIterableToArray(o, minLen) {
|
|
3536
|
-
if (!o)
|
|
3537
|
-
|
|
3538
|
-
if (typeof o === "string")
|
|
3539
|
-
return _arrayLikeToArray(o, minLen);
|
|
3499
|
+
if (!o) return;
|
|
3500
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
3540
3501
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
3541
|
-
if (n === "Object" && o.constructor)
|
|
3542
|
-
|
|
3543
|
-
if (n === "
|
|
3544
|
-
return Array.from(o);
|
|
3545
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
3546
|
-
return _arrayLikeToArray(o, minLen);
|
|
3502
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
3503
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
3504
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
3547
3505
|
}
|
|
3548
3506
|
function _arrayLikeToArray(arr, len) {
|
|
3549
|
-
if (len == null || len > arr.length)
|
|
3550
|
-
len = arr.length;
|
|
3507
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3551
3508
|
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
3552
3509
|
arr2[i] = arr[i];
|
|
3553
3510
|
}
|
|
@@ -3555,8 +3512,7 @@ var require_utils = __commonJS({
|
|
|
3555
3512
|
}
|
|
3556
3513
|
function _iterableToArrayLimit(arr, i) {
|
|
3557
3514
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3558
|
-
if (_i == null)
|
|
3559
|
-
return;
|
|
3515
|
+
if (_i == null) return;
|
|
3560
3516
|
var _arr = [];
|
|
3561
3517
|
var _n = true;
|
|
3562
3518
|
var _d = false;
|
|
@@ -3564,26 +3520,22 @@ var require_utils = __commonJS({
|
|
|
3564
3520
|
try {
|
|
3565
3521
|
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
3566
3522
|
_arr.push(_s.value);
|
|
3567
|
-
if (i && _arr.length === i)
|
|
3568
|
-
break;
|
|
3523
|
+
if (i && _arr.length === i) break;
|
|
3569
3524
|
}
|
|
3570
3525
|
} catch (err) {
|
|
3571
3526
|
_d = true;
|
|
3572
3527
|
_e = err;
|
|
3573
3528
|
} finally {
|
|
3574
3529
|
try {
|
|
3575
|
-
if (!_n && _i["return"] != null)
|
|
3576
|
-
_i["return"]();
|
|
3530
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
3577
3531
|
} finally {
|
|
3578
|
-
if (_d)
|
|
3579
|
-
throw _e;
|
|
3532
|
+
if (_d) throw _e;
|
|
3580
3533
|
}
|
|
3581
3534
|
}
|
|
3582
3535
|
return _arr;
|
|
3583
3536
|
}
|
|
3584
3537
|
function _arrayWithHoles(arr) {
|
|
3585
|
-
if (Array.isArray(arr))
|
|
3586
|
-
return arr;
|
|
3538
|
+
if (Array.isArray(arr)) return arr;
|
|
3587
3539
|
}
|
|
3588
3540
|
function _typeof(obj) {
|
|
3589
3541
|
"@babel/helpers - typeof";
|
|
@@ -3604,7 +3556,7 @@ var require_utils = __commonJS({
|
|
|
3604
3556
|
function getSectionMetadata(ast, name) {
|
|
3605
3557
|
var section;
|
|
3606
3558
|
(0, _traverse.traverse)(ast, {
|
|
3607
|
-
SectionMetadata: function(_SectionMetadata) {
|
|
3559
|
+
SectionMetadata: (function(_SectionMetadata) {
|
|
3608
3560
|
function SectionMetadata(_x) {
|
|
3609
3561
|
return _SectionMetadata.apply(this, arguments);
|
|
3610
3562
|
}
|
|
@@ -3612,7 +3564,7 @@ var require_utils = __commonJS({
|
|
|
3612
3564
|
return _SectionMetadata.toString();
|
|
3613
3565
|
};
|
|
3614
3566
|
return SectionMetadata;
|
|
3615
|
-
}(function(_ref) {
|
|
3567
|
+
})(function(_ref) {
|
|
3616
3568
|
var node = _ref.node;
|
|
3617
3569
|
if (node.section === name) {
|
|
3618
3570
|
section = node;
|
|
@@ -3624,7 +3576,7 @@ var require_utils = __commonJS({
|
|
|
3624
3576
|
function getSectionMetadatas(ast, name) {
|
|
3625
3577
|
var sections = [];
|
|
3626
3578
|
(0, _traverse.traverse)(ast, {
|
|
3627
|
-
SectionMetadata: function(_SectionMetadata2) {
|
|
3579
|
+
SectionMetadata: (function(_SectionMetadata2) {
|
|
3628
3580
|
function SectionMetadata(_x2) {
|
|
3629
3581
|
return _SectionMetadata2.apply(this, arguments);
|
|
3630
3582
|
}
|
|
@@ -3632,7 +3584,7 @@ var require_utils = __commonJS({
|
|
|
3632
3584
|
return _SectionMetadata2.toString();
|
|
3633
3585
|
};
|
|
3634
3586
|
return SectionMetadata;
|
|
3635
|
-
}(function(_ref2) {
|
|
3587
|
+
})(function(_ref2) {
|
|
3636
3588
|
var node = _ref2.node;
|
|
3637
3589
|
if (node.section === name) {
|
|
3638
3590
|
sections.push(node);
|
|
@@ -3794,10 +3746,8 @@ var require_utils = __commonJS({
|
|
|
3794
3746
|
}
|
|
3795
3747
|
}
|
|
3796
3748
|
});
|
|
3797
|
-
|
|
3798
|
-
// node_modules/.pnpm/@webassemblyjs+ast@1.12.1/node_modules/@webassemblyjs/ast/lib/clone.js
|
|
3799
3749
|
var require_clone = __commonJS({
|
|
3800
|
-
"node_modules/.pnpm/@webassemblyjs+ast@1.
|
|
3750
|
+
"node_modules/.pnpm/@webassemblyjs+ast@1.14.1/node_modules/@webassemblyjs/ast/lib/clone.js"(exports) {
|
|
3801
3751
|
Object.defineProperty(exports, "__esModule", {
|
|
3802
3752
|
value: true
|
|
3803
3753
|
});
|
|
@@ -3807,10 +3757,8 @@ var require_clone = __commonJS({
|
|
|
3807
3757
|
}
|
|
3808
3758
|
}
|
|
3809
3759
|
});
|
|
3810
|
-
|
|
3811
|
-
// node_modules/.pnpm/@webassemblyjs+ast@1.12.1/node_modules/@webassemblyjs/ast/lib/transform/ast-module-to-module-context/index.js
|
|
3812
3760
|
var require_ast_module_to_module_context = __commonJS({
|
|
3813
|
-
"node_modules/.pnpm/@webassemblyjs+ast@1.
|
|
3761
|
+
"node_modules/.pnpm/@webassemblyjs+ast@1.14.1/node_modules/@webassemblyjs/ast/lib/transform/ast-module-to-module-context/index.js"(exports) {
|
|
3814
3762
|
Object.defineProperty(exports, "__esModule", {
|
|
3815
3763
|
value: true
|
|
3816
3764
|
});
|
|
@@ -3827,16 +3775,12 @@ var require_ast_module_to_module_context = __commonJS({
|
|
|
3827
3775
|
var descriptor = props[i];
|
|
3828
3776
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
3829
3777
|
descriptor.configurable = true;
|
|
3830
|
-
if ("value" in descriptor)
|
|
3831
|
-
descriptor.writable = true;
|
|
3778
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
3832
3779
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
3833
3780
|
}
|
|
3834
3781
|
}
|
|
3835
3782
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
3836
|
-
if (protoProps)
|
|
3837
|
-
_defineProperties(Constructor.prototype, protoProps);
|
|
3838
|
-
if (staticProps)
|
|
3839
|
-
_defineProperties(Constructor, staticProps);
|
|
3783
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
3840
3784
|
return Constructor;
|
|
3841
3785
|
}
|
|
3842
3786
|
function moduleContextFromModuleAST(m) {
|
|
@@ -3892,7 +3836,7 @@ var require_ast_module_to_module_context = __commonJS({
|
|
|
3892
3836
|
});
|
|
3893
3837
|
return moduleContext;
|
|
3894
3838
|
}
|
|
3895
|
-
var ModuleContext = /* @__PURE__ */ function() {
|
|
3839
|
+
var ModuleContext = /* @__PURE__ */ (function() {
|
|
3896
3840
|
function ModuleContext2() {
|
|
3897
3841
|
_classCallCheck(this, ModuleContext2);
|
|
3898
3842
|
this.funcs = [];
|
|
@@ -4139,14 +4083,12 @@ var require_ast_module_to_module_context = __commonJS({
|
|
|
4139
4083
|
}
|
|
4140
4084
|
}]);
|
|
4141
4085
|
return ModuleContext2;
|
|
4142
|
-
}();
|
|
4086
|
+
})();
|
|
4143
4087
|
exports.ModuleContext = ModuleContext;
|
|
4144
4088
|
}
|
|
4145
4089
|
});
|
|
4146
|
-
|
|
4147
|
-
// node_modules/.pnpm/@webassemblyjs+ast@1.12.1/node_modules/@webassemblyjs/ast/lib/index.js
|
|
4148
4090
|
var require_lib7 = __commonJS({
|
|
4149
|
-
"node_modules/.pnpm/@webassemblyjs+ast@1.
|
|
4091
|
+
"node_modules/.pnpm/@webassemblyjs+ast@1.14.1/node_modules/@webassemblyjs/ast/lib/index.js"(exports) {
|
|
4150
4092
|
Object.defineProperty(exports, "__esModule", {
|
|
4151
4093
|
value: true
|
|
4152
4094
|
});
|
|
@@ -4238,12 +4180,9 @@ var require_lib7 = __commonJS({
|
|
|
4238
4180
|
});
|
|
4239
4181
|
var _nodes = require_nodes();
|
|
4240
4182
|
Object.keys(_nodes).forEach(function(key) {
|
|
4241
|
-
if (key === "default" || key === "__esModule")
|
|
4242
|
-
|
|
4243
|
-
if (
|
|
4244
|
-
return;
|
|
4245
|
-
if (key in exports && exports[key] === _nodes[key])
|
|
4246
|
-
return;
|
|
4183
|
+
if (key === "default" || key === "__esModule") return;
|
|
4184
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
4185
|
+
if (key in exports && exports[key] === _nodes[key]) return;
|
|
4247
4186
|
Object.defineProperty(exports, key, {
|
|
4248
4187
|
enumerable: true,
|
|
4249
4188
|
get: function get() {
|
|
@@ -4256,12 +4195,9 @@ var require_lib7 = __commonJS({
|
|
|
4256
4195
|
var _signatures = require_signatures();
|
|
4257
4196
|
var _utils = require_utils();
|
|
4258
4197
|
Object.keys(_utils).forEach(function(key) {
|
|
4259
|
-
if (key === "default" || key === "__esModule")
|
|
4260
|
-
|
|
4261
|
-
if (
|
|
4262
|
-
return;
|
|
4263
|
-
if (key in exports && exports[key] === _utils[key])
|
|
4264
|
-
return;
|
|
4198
|
+
if (key === "default" || key === "__esModule") return;
|
|
4199
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
4200
|
+
if (key in exports && exports[key] === _utils[key]) return;
|
|
4265
4201
|
Object.defineProperty(exports, key, {
|
|
4266
4202
|
enumerable: true,
|
|
4267
4203
|
get: function get() {
|
|
@@ -4273,10 +4209,8 @@ var require_lib7 = __commonJS({
|
|
|
4273
4209
|
var _astModuleToModuleContext = require_ast_module_to_module_context();
|
|
4274
4210
|
}
|
|
4275
4211
|
});
|
|
4276
|
-
|
|
4277
|
-
// node_modules/.pnpm/@webassemblyjs+leb128@1.11.6/node_modules/@webassemblyjs/leb128/lib/bits.js
|
|
4278
4212
|
var require_bits = __commonJS({
|
|
4279
|
-
"node_modules/.pnpm/@webassemblyjs+leb128@1.
|
|
4213
|
+
"node_modules/.pnpm/@webassemblyjs+leb128@1.14.1/node_modules/@webassemblyjs/leb128/lib/bits.js"(exports) {
|
|
4280
4214
|
Object.defineProperty(exports, "__esModule", {
|
|
4281
4215
|
value: true
|
|
4282
4216
|
});
|
|
@@ -4362,10 +4296,8 @@ var require_bits = __commonJS({
|
|
|
4362
4296
|
}
|
|
4363
4297
|
}
|
|
4364
4298
|
});
|
|
4365
|
-
|
|
4366
|
-
// node_modules/.pnpm/@webassemblyjs+leb128@1.11.6/node_modules/@webassemblyjs/leb128/lib/bufs.js
|
|
4367
4299
|
var require_bufs = __commonJS({
|
|
4368
|
-
"node_modules/.pnpm/@webassemblyjs+leb128@1.
|
|
4300
|
+
"node_modules/.pnpm/@webassemblyjs+leb128@1.14.1/node_modules/@webassemblyjs/leb128/lib/bufs.js"(exports) {
|
|
4369
4301
|
Object.defineProperty(exports, "__esModule", {
|
|
4370
4302
|
value: true
|
|
4371
4303
|
});
|
|
@@ -4405,7 +4337,7 @@ var require_bufs = __commonJS({
|
|
|
4405
4337
|
if (result) {
|
|
4406
4338
|
bufPool[length] = void 0;
|
|
4407
4339
|
} else {
|
|
4408
|
-
result = new
|
|
4340
|
+
result = new Uint8Array(length);
|
|
4409
4341
|
}
|
|
4410
4342
|
result.fill(0);
|
|
4411
4343
|
return result;
|
|
@@ -4421,7 +4353,9 @@ var require_bufs = __commonJS({
|
|
|
4421
4353
|
return buffer;
|
|
4422
4354
|
}
|
|
4423
4355
|
var newBuf = alloc(length);
|
|
4424
|
-
buffer.
|
|
4356
|
+
for (var i = 0; i <= buffer.length; i++) {
|
|
4357
|
+
newBuf[i] = buffer[i];
|
|
4358
|
+
}
|
|
4425
4359
|
free(buffer);
|
|
4426
4360
|
return newBuf;
|
|
4427
4361
|
}
|
|
@@ -4487,15 +4421,19 @@ var require_bufs = __commonJS({
|
|
|
4487
4421
|
}
|
|
4488
4422
|
var lowWord = value % BIT_32;
|
|
4489
4423
|
var highWord = Math.floor(value / BIT_32);
|
|
4490
|
-
buffer
|
|
4491
|
-
buffer
|
|
4424
|
+
buffer[0] = lowWord & 255;
|
|
4425
|
+
buffer[1] = lowWord >> 8 & 255;
|
|
4426
|
+
buffer[2] = lowWord >> 16 & 255;
|
|
4427
|
+
buffer[3] = lowWord >> 24 & 255;
|
|
4428
|
+
buffer[4] = highWord & 255;
|
|
4429
|
+
buffer[5] = highWord >> 8 & 255;
|
|
4430
|
+
buffer[6] = highWord >> 16 & 255;
|
|
4431
|
+
buffer[7] = highWord >> 24 & 255;
|
|
4492
4432
|
}
|
|
4493
4433
|
}
|
|
4494
4434
|
});
|
|
4495
|
-
|
|
4496
|
-
// node_modules/.pnpm/@webassemblyjs+leb128@1.11.6/node_modules/@webassemblyjs/leb128/lib/leb.js
|
|
4497
4435
|
var require_leb = __commonJS({
|
|
4498
|
-
"node_modules/.pnpm/@webassemblyjs+leb128@1.
|
|
4436
|
+
"node_modules/.pnpm/@webassemblyjs+leb128@1.14.1/node_modules/@webassemblyjs/leb128/lib/leb.js"(exports) {
|
|
4499
4437
|
function _typeof(obj) {
|
|
4500
4438
|
"@babel/helpers - typeof";
|
|
4501
4439
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
@@ -4517,8 +4455,7 @@ var require_leb = __commonJS({
|
|
|
4517
4455
|
var bits = _interopRequireWildcard(require_bits());
|
|
4518
4456
|
var bufs = _interopRequireWildcard(require_bufs());
|
|
4519
4457
|
function _getRequireWildcardCache(nodeInterop) {
|
|
4520
|
-
if (typeof WeakMap !== "function")
|
|
4521
|
-
return null;
|
|
4458
|
+
if (typeof WeakMap !== "function") return null;
|
|
4522
4459
|
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
|
|
4523
4460
|
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
|
4524
4461
|
return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
|
|
@@ -4526,7 +4463,7 @@ var require_leb = __commonJS({
|
|
|
4526
4463
|
})(nodeInterop);
|
|
4527
4464
|
}
|
|
4528
4465
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
4529
|
-
if (
|
|
4466
|
+
if (obj && obj.__esModule) {
|
|
4530
4467
|
return obj;
|
|
4531
4468
|
}
|
|
4532
4469
|
if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
|
|
@@ -4639,10 +4576,12 @@ var require_leb = __commonJS({
|
|
|
4639
4576
|
return decodeBufferCommon(encodedBuffer, index, true);
|
|
4640
4577
|
}
|
|
4641
4578
|
function encodeInt32(num) {
|
|
4642
|
-
var buf =
|
|
4643
|
-
buf
|
|
4579
|
+
var buf = new Uint8Array(4);
|
|
4580
|
+
buf[0] = num & 255;
|
|
4581
|
+
buf[1] = num >> 8 & 255;
|
|
4582
|
+
buf[2] = num >> 16 & 255;
|
|
4583
|
+
buf[3] = num >> 24 & 255;
|
|
4644
4584
|
var result = encodeIntBuffer(buf);
|
|
4645
|
-
bufs.free(buf);
|
|
4646
4585
|
return result;
|
|
4647
4586
|
}
|
|
4648
4587
|
function decodeInt32(encodedBuffer, index) {
|
|
@@ -4687,10 +4626,12 @@ var require_leb = __commonJS({
|
|
|
4687
4626
|
return decodeBufferCommon(encodedBuffer, index, false);
|
|
4688
4627
|
}
|
|
4689
4628
|
function encodeUInt32(num) {
|
|
4690
|
-
var buf =
|
|
4691
|
-
buf
|
|
4629
|
+
var buf = new Uint8Array(4);
|
|
4630
|
+
buf[0] = num & 255;
|
|
4631
|
+
buf[1] = num >> 8 & 255;
|
|
4632
|
+
buf[2] = num >> 16 & 255;
|
|
4633
|
+
buf[3] = num >> 24 & 255;
|
|
4692
4634
|
var result = encodeUIntBuffer(buf);
|
|
4693
|
-
bufs.free(buf);
|
|
4694
4635
|
return result;
|
|
4695
4636
|
}
|
|
4696
4637
|
function decodeUInt32(encodedBuffer, index) {
|
|
@@ -4740,10 +4681,8 @@ var require_leb = __commonJS({
|
|
|
4740
4681
|
exports["default"] = _default;
|
|
4741
4682
|
}
|
|
4742
4683
|
});
|
|
4743
|
-
|
|
4744
|
-
// node_modules/.pnpm/@webassemblyjs+leb128@1.11.6/node_modules/@webassemblyjs/leb128/lib/index.js
|
|
4745
4684
|
var require_lib8 = __commonJS({
|
|
4746
|
-
"node_modules/.pnpm/@webassemblyjs+leb128@1.
|
|
4685
|
+
"node_modules/.pnpm/@webassemblyjs+leb128@1.14.1/node_modules/@webassemblyjs/leb128/lib/index.js"(exports) {
|
|
4747
4686
|
Object.defineProperty(exports, "__esModule", {
|
|
4748
4687
|
value: true
|
|
4749
4688
|
});
|
|
@@ -4786,10 +4725,8 @@ var require_lib8 = __commonJS({
|
|
|
4786
4725
|
}
|
|
4787
4726
|
}
|
|
4788
4727
|
});
|
|
4789
|
-
|
|
4790
|
-
// node_modules/.pnpm/@webassemblyjs+wasm-parser@1.12.1/node_modules/@webassemblyjs/wasm-parser/lib/decoder.js
|
|
4791
4728
|
var require_decoder2 = __commonJS({
|
|
4792
|
-
"node_modules/.pnpm/@webassemblyjs+wasm-parser@1.
|
|
4729
|
+
"node_modules/.pnpm/@webassemblyjs+wasm-parser@1.14.1/node_modules/@webassemblyjs/wasm-parser/lib/decoder.js"(exports) {
|
|
4793
4730
|
function _typeof(obj) {
|
|
4794
4731
|
"@babel/helpers - typeof";
|
|
4795
4732
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
@@ -4817,8 +4754,7 @@ var require_decoder2 = __commonJS({
|
|
|
4817
4754
|
return obj && obj.__esModule ? obj : { "default": obj };
|
|
4818
4755
|
}
|
|
4819
4756
|
function _getRequireWildcardCache(nodeInterop) {
|
|
4820
|
-
if (typeof WeakMap !== "function")
|
|
4821
|
-
return null;
|
|
4757
|
+
if (typeof WeakMap !== "function") return null;
|
|
4822
4758
|
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
|
|
4823
4759
|
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
|
4824
4760
|
return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
|
|
@@ -4826,7 +4762,7 @@ var require_decoder2 = __commonJS({
|
|
|
4826
4762
|
})(nodeInterop);
|
|
4827
4763
|
}
|
|
4828
4764
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
4829
|
-
if (
|
|
4765
|
+
if (obj && obj.__esModule) {
|
|
4830
4766
|
return obj;
|
|
4831
4767
|
}
|
|
4832
4768
|
if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
|
|
@@ -4861,29 +4797,21 @@ var require_decoder2 = __commonJS({
|
|
|
4861
4797
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4862
4798
|
}
|
|
4863
4799
|
function _unsupportedIterableToArray(o, minLen) {
|
|
4864
|
-
if (!o)
|
|
4865
|
-
|
|
4866
|
-
if (typeof o === "string")
|
|
4867
|
-
return _arrayLikeToArray(o, minLen);
|
|
4800
|
+
if (!o) return;
|
|
4801
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
4868
4802
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
4869
|
-
if (n === "Object" && o.constructor)
|
|
4870
|
-
|
|
4871
|
-
if (n === "
|
|
4872
|
-
return Array.from(o);
|
|
4873
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
4874
|
-
return _arrayLikeToArray(o, minLen);
|
|
4803
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
4804
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
4805
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
4875
4806
|
}
|
|
4876
4807
|
function _iterableToArray(iter) {
|
|
4877
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
4878
|
-
return Array.from(iter);
|
|
4808
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
4879
4809
|
}
|
|
4880
4810
|
function _arrayWithoutHoles(arr) {
|
|
4881
|
-
if (Array.isArray(arr))
|
|
4882
|
-
return _arrayLikeToArray(arr);
|
|
4811
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
4883
4812
|
}
|
|
4884
4813
|
function _arrayLikeToArray(arr, len) {
|
|
4885
|
-
if (len == null || len > arr.length)
|
|
4886
|
-
len = arr.length;
|
|
4814
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
4887
4815
|
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
4888
4816
|
arr2[i] = arr[i];
|
|
4889
4817
|
}
|
|
@@ -4914,8 +4842,7 @@ var require_decoder2 = __commonJS({
|
|
|
4914
4842
|
};
|
|
4915
4843
|
}
|
|
4916
4844
|
function dump(b, msg) {
|
|
4917
|
-
if (opts.dump === false)
|
|
4918
|
-
return;
|
|
4845
|
+
if (opts.dump === false) return;
|
|
4919
4846
|
var pad = " ";
|
|
4920
4847
|
var str = "";
|
|
4921
4848
|
if (b.length < 5) {
|
|
@@ -4926,12 +4853,10 @@ var require_decoder2 = __commonJS({
|
|
|
4926
4853
|
console.log(toHex(offset) + ": ", str, pad, ";", msg);
|
|
4927
4854
|
}
|
|
4928
4855
|
function dumpSep(msg) {
|
|
4929
|
-
if (opts.dump === false)
|
|
4930
|
-
return;
|
|
4856
|
+
if (opts.dump === false) return;
|
|
4931
4857
|
console.log(";", msg);
|
|
4932
4858
|
}
|
|
4933
4859
|
var state = {
|
|
4934
|
-
elementsInFuncSection: [],
|
|
4935
4860
|
elementsInExportSection: [],
|
|
4936
4861
|
elementsInCodeSection: [],
|
|
4937
4862
|
/**
|
|
@@ -5131,7 +5056,11 @@ var require_decoder2 = __commonJS({
|
|
|
5131
5056
|
if (type == _helperWasmBytecode["default"].types.func) {
|
|
5132
5057
|
dump([type], "func");
|
|
5133
5058
|
var paramValtypes = parseVec(function(b) {
|
|
5134
|
-
|
|
5059
|
+
var valtype = _helperWasmBytecode["default"].valtypes[b];
|
|
5060
|
+
if (valtype === void 0) {
|
|
5061
|
+
throw new Error("unexpected value type ".concat(b));
|
|
5062
|
+
}
|
|
5063
|
+
return valtype;
|
|
5135
5064
|
});
|
|
5136
5065
|
var params = paramValtypes.map(function(v) {
|
|
5137
5066
|
return t.funcParam(
|
|
@@ -5142,10 +5071,10 @@ var require_decoder2 = __commonJS({
|
|
|
5142
5071
|
var result = parseVec(function(b) {
|
|
5143
5072
|
return _helperWasmBytecode["default"].valtypes[b];
|
|
5144
5073
|
});
|
|
5145
|
-
typeInstructionNodes.push(function() {
|
|
5074
|
+
typeInstructionNodes.push((function() {
|
|
5146
5075
|
var endLoc = getPosition();
|
|
5147
5076
|
return t.withLoc(t.typeInstruction(void 0, t.signature(params, result)), endLoc, _startLoc);
|
|
5148
|
-
}());
|
|
5077
|
+
})());
|
|
5149
5078
|
state.typesInModule.push({
|
|
5150
5079
|
params,
|
|
5151
5080
|
result
|
|
@@ -5204,10 +5133,10 @@ var require_decoder2 = __commonJS({
|
|
|
5204
5133
|
} else {
|
|
5205
5134
|
throw new _helperApiError.CompileError("Unsupported import of type: " + descrType);
|
|
5206
5135
|
}
|
|
5207
|
-
imports.push(function() {
|
|
5136
|
+
imports.push((function() {
|
|
5208
5137
|
var endLoc = getPosition();
|
|
5209
5138
|
return t.withLoc(t.moduleImport(moduleName.value, name.value, importDescr), endLoc, _startLoc2);
|
|
5210
|
-
}());
|
|
5139
|
+
})());
|
|
5211
5140
|
}
|
|
5212
5141
|
return imports;
|
|
5213
5142
|
}
|
|
@@ -5316,10 +5245,10 @@ var require_decoder2 = __commonJS({
|
|
|
5316
5245
|
for (var _i2 = 0; _i2 < localCount; _i2++) {
|
|
5317
5246
|
args.push(t.valtypeLiteral(type));
|
|
5318
5247
|
}
|
|
5319
|
-
var localNode = function() {
|
|
5248
|
+
var localNode = (function() {
|
|
5320
5249
|
var endLoc2 = getPosition();
|
|
5321
5250
|
return t.withLoc(t.instruction("local", args), endLoc2, _startLoc5);
|
|
5322
|
-
}();
|
|
5251
|
+
})();
|
|
5323
5252
|
locals.push(localNode);
|
|
5324
5253
|
dump([valtypeByte], type);
|
|
5325
5254
|
if (typeof type === "undefined") {
|
|
@@ -5348,20 +5277,27 @@ var require_decoder2 = __commonJS({
|
|
|
5348
5277
|
instructionByte = 65024 + readByte();
|
|
5349
5278
|
eatBytes(1);
|
|
5350
5279
|
}
|
|
5280
|
+
if (instructionByte === 252) {
|
|
5281
|
+
instructionByte = 64512 + readByte();
|
|
5282
|
+
eatBytes(1);
|
|
5283
|
+
}
|
|
5351
5284
|
var instruction = _helperWasmBytecode["default"].symbolsByByte[instructionByte];
|
|
5352
5285
|
if (typeof instruction === "undefined") {
|
|
5353
5286
|
throw new _helperApiError.CompileError("Unexpected instruction: " + toHex(instructionByte));
|
|
5354
5287
|
}
|
|
5288
|
+
if (instruction === "illegal") {
|
|
5289
|
+
throw new Error("tried to decode an illegal bytecode: ".concat(toHex(instructionByte)));
|
|
5290
|
+
}
|
|
5355
5291
|
if (typeof instruction.object === "string") {
|
|
5356
5292
|
dump([instructionByte], "".concat(instruction.object, ".").concat(instruction.name));
|
|
5357
5293
|
} else {
|
|
5358
5294
|
dump([instructionByte], instruction.name);
|
|
5359
5295
|
}
|
|
5360
5296
|
if (instruction.name === "end") {
|
|
5361
|
-
var node = function() {
|
|
5297
|
+
var node = (function() {
|
|
5362
5298
|
var endLoc = getPosition();
|
|
5363
5299
|
return t.withLoc(t.instruction(instruction.name), endLoc, _startLoc6);
|
|
5364
|
-
}();
|
|
5300
|
+
})();
|
|
5365
5301
|
code.push(node);
|
|
5366
5302
|
break;
|
|
5367
5303
|
}
|
|
@@ -5369,31 +5305,19 @@ var require_decoder2 = __commonJS({
|
|
|
5369
5305
|
var namedArgs = void 0;
|
|
5370
5306
|
if (instruction.name === "loop") {
|
|
5371
5307
|
var _startLoc7 = getPosition();
|
|
5372
|
-
var
|
|
5373
|
-
eatBytes(1);
|
|
5374
|
-
var blocktype = _helperWasmBytecode["default"].blockTypes[blocktypeByte];
|
|
5375
|
-
dump([blocktypeByte], "blocktype");
|
|
5376
|
-
if (typeof blocktype === "undefined") {
|
|
5377
|
-
throw new _helperApiError.CompileError("Unexpected blocktype: " + toHex(blocktypeByte));
|
|
5378
|
-
}
|
|
5308
|
+
var blocktype = parseBlockType();
|
|
5379
5309
|
var instr = [];
|
|
5380
5310
|
parseInstructionBlock(instr);
|
|
5381
5311
|
var label = t.withRaw(t.identifier(getUniqueName("loop")), "");
|
|
5382
|
-
var loopNode = function() {
|
|
5312
|
+
var loopNode = (function() {
|
|
5383
5313
|
var endLoc = getPosition();
|
|
5384
5314
|
return t.withLoc(t.loopInstruction(label, blocktype, instr), endLoc, _startLoc7);
|
|
5385
|
-
}();
|
|
5315
|
+
})();
|
|
5386
5316
|
code.push(loopNode);
|
|
5387
5317
|
instructionAlreadyCreated = true;
|
|
5388
5318
|
} else if (instruction.name === "if") {
|
|
5389
5319
|
var _startLoc8 = getPosition();
|
|
5390
|
-
var
|
|
5391
|
-
eatBytes(1);
|
|
5392
|
-
var _blocktype = _helperWasmBytecode["default"].blockTypes[_blocktypeByte];
|
|
5393
|
-
dump([_blocktypeByte], "blocktype");
|
|
5394
|
-
if (typeof _blocktype === "undefined") {
|
|
5395
|
-
throw new _helperApiError.CompileError("Unexpected blocktype: " + toHex(_blocktypeByte));
|
|
5396
|
-
}
|
|
5320
|
+
var _blocktype = parseBlockType();
|
|
5397
5321
|
var testIndex = t.withRaw(t.identifier(getUniqueName("if")), "");
|
|
5398
5322
|
var ifBody = [];
|
|
5399
5323
|
parseInstructionBlock(ifBody);
|
|
@@ -5407,28 +5331,22 @@ var require_decoder2 = __commonJS({
|
|
|
5407
5331
|
var consequentInstr = ifBody.slice(0, elseIndex);
|
|
5408
5332
|
var alternate = ifBody.slice(elseIndex + 1);
|
|
5409
5333
|
var testInstrs = [];
|
|
5410
|
-
var ifNode = function() {
|
|
5334
|
+
var ifNode = (function() {
|
|
5411
5335
|
var endLoc = getPosition();
|
|
5412
5336
|
return t.withLoc(t.ifInstruction(testIndex, testInstrs, _blocktype, consequentInstr, alternate), endLoc, _startLoc8);
|
|
5413
|
-
}();
|
|
5337
|
+
})();
|
|
5414
5338
|
code.push(ifNode);
|
|
5415
5339
|
instructionAlreadyCreated = true;
|
|
5416
5340
|
} else if (instruction.name === "block") {
|
|
5417
5341
|
var _startLoc9 = getPosition();
|
|
5418
|
-
var
|
|
5419
|
-
eatBytes(1);
|
|
5420
|
-
var _blocktype2 = _helperWasmBytecode["default"].blockTypes[_blocktypeByte2];
|
|
5421
|
-
dump([_blocktypeByte2], "blocktype");
|
|
5422
|
-
if (typeof _blocktype2 === "undefined") {
|
|
5423
|
-
throw new _helperApiError.CompileError("Unexpected blocktype: " + toHex(_blocktypeByte2));
|
|
5424
|
-
}
|
|
5342
|
+
var _blocktype2 = parseBlockType();
|
|
5425
5343
|
var _instr2 = [];
|
|
5426
5344
|
parseInstructionBlock(_instr2);
|
|
5427
5345
|
var _label = t.withRaw(t.identifier(getUniqueName("block")), "");
|
|
5428
|
-
var blockNode = function() {
|
|
5346
|
+
var blockNode = (function() {
|
|
5429
5347
|
var endLoc = getPosition();
|
|
5430
5348
|
return t.withLoc(t.blockInstruction(_label, _instr2, _blocktype2), endLoc, _startLoc9);
|
|
5431
|
-
}();
|
|
5349
|
+
})();
|
|
5432
5350
|
code.push(blockNode);
|
|
5433
5351
|
instructionAlreadyCreated = true;
|
|
5434
5352
|
} else if (instruction.name === "call") {
|
|
@@ -5436,10 +5354,10 @@ var require_decoder2 = __commonJS({
|
|
|
5436
5354
|
var index = indexu32.value;
|
|
5437
5355
|
eatBytes(indexu32.nextIndex);
|
|
5438
5356
|
dump([index], "index");
|
|
5439
|
-
var callNode = function() {
|
|
5357
|
+
var callNode = (function() {
|
|
5440
5358
|
var endLoc = getPosition();
|
|
5441
5359
|
return t.withLoc(t.callInstruction(t.indexLiteral(index)), endLoc, _startLoc6);
|
|
5442
|
-
}();
|
|
5360
|
+
})();
|
|
5443
5361
|
code.push(callNode);
|
|
5444
5362
|
instructionAlreadyCreated = true;
|
|
5445
5363
|
} else if (instruction.name === "call_indirect") {
|
|
@@ -5459,10 +5377,10 @@ var require_decoder2 = __commonJS({
|
|
|
5459
5377
|
if (flag !== 0) {
|
|
5460
5378
|
throw new _helperApiError.CompileError("zero flag expected");
|
|
5461
5379
|
}
|
|
5462
|
-
code.push(function() {
|
|
5380
|
+
code.push((function() {
|
|
5463
5381
|
var endLoc = getPosition();
|
|
5464
5382
|
return t.withLoc(_callNode, endLoc, _startLoc10);
|
|
5465
|
-
}());
|
|
5383
|
+
})());
|
|
5466
5384
|
instructionAlreadyCreated = true;
|
|
5467
5385
|
} else if (instruction.name === "br_table") {
|
|
5468
5386
|
var indicesu32 = readU32();
|
|
@@ -5494,8 +5412,7 @@ var require_decoder2 = __commonJS({
|
|
|
5494
5412
|
var _offset2 = offsetu32.value;
|
|
5495
5413
|
eatBytes(offsetu32.nextIndex);
|
|
5496
5414
|
dump([_offset2], "offset");
|
|
5497
|
-
if (namedArgs === void 0)
|
|
5498
|
-
namedArgs = {};
|
|
5415
|
+
if (namedArgs === void 0) namedArgs = {};
|
|
5499
5416
|
namedArgs.offset = t.numberLiteralFromRaw(_offset2);
|
|
5500
5417
|
}
|
|
5501
5418
|
} else if (instructionByte >= 65 && instructionByte <= 68) {
|
|
@@ -5582,16 +5499,16 @@ var require_decoder2 = __commonJS({
|
|
|
5582
5499
|
}
|
|
5583
5500
|
if (instructionAlreadyCreated === false) {
|
|
5584
5501
|
if (typeof instruction.object === "string") {
|
|
5585
|
-
var _node3 = function() {
|
|
5502
|
+
var _node3 = (function() {
|
|
5586
5503
|
var endLoc = getPosition();
|
|
5587
5504
|
return t.withLoc(t.objectInstruction(instruction.name, instruction.object, args, namedArgs), endLoc, _startLoc6);
|
|
5588
|
-
}();
|
|
5505
|
+
})();
|
|
5589
5506
|
code.push(_node3);
|
|
5590
5507
|
} else {
|
|
5591
|
-
var _node4 = function() {
|
|
5508
|
+
var _node4 = (function() {
|
|
5592
5509
|
var endLoc = getPosition();
|
|
5593
5510
|
return t.withLoc(t.instruction(instruction.name, args, namedArgs), endLoc, _startLoc6);
|
|
5594
|
-
}();
|
|
5511
|
+
})();
|
|
5595
5512
|
code.push(_node4);
|
|
5596
5513
|
}
|
|
5597
5514
|
}
|
|
@@ -5628,7 +5545,7 @@ var require_decoder2 = __commonJS({
|
|
|
5628
5545
|
dump([elementTypeByte], "element type");
|
|
5629
5546
|
var elementType = _helperWasmBytecode["default"].tableTypes[elementTypeByte];
|
|
5630
5547
|
if (typeof elementType === "undefined") {
|
|
5631
|
-
throw new _helperApiError.CompileError("Unknown element type in table: " + toHex(
|
|
5548
|
+
throw new _helperApiError.CompileError("Unknown element type in table: " + toHex(elementTypeByte));
|
|
5632
5549
|
}
|
|
5633
5550
|
var limits = parseLimits();
|
|
5634
5551
|
return t.table(elementType, limits, name);
|
|
@@ -5697,6 +5614,16 @@ var require_decoder2 = __commonJS({
|
|
|
5697
5614
|
var subSectionSizeInBytesu32 = readVaruint32();
|
|
5698
5615
|
eatBytes(subSectionSizeInBytesu32.nextIndex);
|
|
5699
5616
|
switch (sectionTypeByte.value) {
|
|
5617
|
+
// case 0: {
|
|
5618
|
+
// TODO(sven): re-enable that
|
|
5619
|
+
// Current status: it seems that when we decode the module's name
|
|
5620
|
+
// no name_payload_len is used.
|
|
5621
|
+
//
|
|
5622
|
+
// See https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md#name-section
|
|
5623
|
+
//
|
|
5624
|
+
// nameMetadata.push(...parseNameModule());
|
|
5625
|
+
// break;
|
|
5626
|
+
// }
|
|
5700
5627
|
case 1: {
|
|
5701
5628
|
nameMetadata.push.apply(nameMetadata, _toConsumableArray(parseNameSectionFunctions()));
|
|
5702
5629
|
break;
|
|
@@ -5746,10 +5673,10 @@ var require_decoder2 = __commonJS({
|
|
|
5746
5673
|
var globalType = parseGlobalType();
|
|
5747
5674
|
var init = [];
|
|
5748
5675
|
parseInstructionBlock(init);
|
|
5749
|
-
var node = function() {
|
|
5676
|
+
var node = (function() {
|
|
5750
5677
|
var endLoc = getPosition();
|
|
5751
5678
|
return t.withLoc(t.global(globalType, init), endLoc, _startLoc11);
|
|
5752
|
-
}();
|
|
5679
|
+
})();
|
|
5753
5680
|
globals.push(node);
|
|
5754
5681
|
state.globalsInModule.push(node);
|
|
5755
5682
|
}
|
|
@@ -5761,28 +5688,130 @@ var require_decoder2 = __commonJS({
|
|
|
5761
5688
|
for (var i = 0; i < numberOfElements; i++) {
|
|
5762
5689
|
var _startLoc12 = getPosition();
|
|
5763
5690
|
var tableindexu32 = readU32();
|
|
5764
|
-
var
|
|
5691
|
+
var bitfield = tableindexu32.value;
|
|
5765
5692
|
eatBytes(tableindexu32.nextIndex);
|
|
5766
|
-
dump([
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
var
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5693
|
+
dump([bitfield], "bitfield");
|
|
5694
|
+
if (bitfield === 0) {
|
|
5695
|
+
var instr = [];
|
|
5696
|
+
parseInstructionBlock(instr);
|
|
5697
|
+
var indicesu32 = readU32();
|
|
5698
|
+
var indices = indicesu32.value;
|
|
5699
|
+
eatBytes(indicesu32.nextIndex);
|
|
5700
|
+
dump([indices], "num indices");
|
|
5701
|
+
var indexValues = [];
|
|
5702
|
+
for (var _i5 = 0; _i5 < indices; _i5++) {
|
|
5703
|
+
var indexu32 = readU32();
|
|
5704
|
+
var index = indexu32.value;
|
|
5705
|
+
eatBytes(indexu32.nextIndex);
|
|
5706
|
+
dump([index], "index");
|
|
5707
|
+
indexValues.push(t.indexLiteral(index));
|
|
5708
|
+
}
|
|
5709
|
+
var elemNode = (function() {
|
|
5710
|
+
var endLoc = getPosition();
|
|
5711
|
+
return t.withLoc(t.elem(t.indexLiteral(bitfield), instr, indexValues), endLoc, _startLoc12);
|
|
5712
|
+
})();
|
|
5713
|
+
elems.push(elemNode);
|
|
5714
|
+
} else if (bitfield === 1) {
|
|
5715
|
+
var elemKind = readByte();
|
|
5716
|
+
eatBytes(1);
|
|
5717
|
+
if (elemKind !== 0) {
|
|
5718
|
+
throw new Error("unexpected Elem kind: ".concat(toHex(elemKind)));
|
|
5719
|
+
}
|
|
5720
|
+
var _indicesu = readU32();
|
|
5721
|
+
var _indices = _indicesu.value;
|
|
5722
|
+
eatBytes(_indicesu.nextIndex);
|
|
5723
|
+
dump([_indices], "num indices");
|
|
5724
|
+
var _indexValues = [];
|
|
5725
|
+
for (var _i6 = 0; _i6 < _indices; _i6++) {
|
|
5726
|
+
var _indexu2 = readU32();
|
|
5727
|
+
var _index3 = _indexu2.value;
|
|
5728
|
+
eatBytes(_indexu2.nextIndex);
|
|
5729
|
+
dump([_index3], "index");
|
|
5730
|
+
_indexValues.push(t.indexLiteral(_index3));
|
|
5731
|
+
}
|
|
5732
|
+
} else if (bitfield === 2) {
|
|
5733
|
+
var u32 = readU32();
|
|
5734
|
+
var tableidx = u32.value;
|
|
5735
|
+
eatBytes(u32.nextIndex);
|
|
5736
|
+
dump([tableidx], "tableidx");
|
|
5737
|
+
var _instr3 = [];
|
|
5738
|
+
parseInstructionBlock(_instr3);
|
|
5739
|
+
var _elemKind = readByte();
|
|
5740
|
+
eatBytes(1);
|
|
5741
|
+
if (_elemKind !== 0) {
|
|
5742
|
+
throw new Error("unexpected Elem kind: ".concat(toHex(_elemKind)));
|
|
5743
|
+
}
|
|
5744
|
+
var _indicesu2 = readU32();
|
|
5745
|
+
var _indices2 = _indicesu2.value;
|
|
5746
|
+
eatBytes(_indicesu2.nextIndex);
|
|
5747
|
+
dump([_indices2], "num indices");
|
|
5748
|
+
var _indexValues2 = [];
|
|
5749
|
+
for (var _i7 = 0; _i7 < _indices2; _i7++) {
|
|
5750
|
+
var _indexu3 = readU32();
|
|
5751
|
+
var _index4 = _indexu3.value;
|
|
5752
|
+
eatBytes(_indexu3.nextIndex);
|
|
5753
|
+
dump([_index4], "index");
|
|
5754
|
+
_indexValues2.push(t.indexLiteral(_index4));
|
|
5755
|
+
}
|
|
5756
|
+
var _elemNode = (function() {
|
|
5757
|
+
var endLoc = getPosition();
|
|
5758
|
+
return t.withLoc(t.elem(t.indexLiteral(bitfield), _instr3, _indexValues2), endLoc, _startLoc12);
|
|
5759
|
+
})();
|
|
5760
|
+
elems.push(_elemNode);
|
|
5761
|
+
} else if (bitfield === 3) {
|
|
5762
|
+
var _elemKind2 = readByte();
|
|
5763
|
+
eatBytes(1);
|
|
5764
|
+
if (_elemKind2 !== 0) {
|
|
5765
|
+
throw new Error("unexpected Elem kind: ".concat(toHex(_elemKind2)));
|
|
5766
|
+
}
|
|
5767
|
+
var countU32 = readU32();
|
|
5768
|
+
var count = countU32.value;
|
|
5769
|
+
eatBytes(countU32.nextIndex);
|
|
5770
|
+
dump([count], "count");
|
|
5771
|
+
for (var _i8 = 0; _i8 < count; _i8++) {
|
|
5772
|
+
var _indexu4 = readU32();
|
|
5773
|
+
var _index5 = _indexu4.value;
|
|
5774
|
+
eatBytes(_indexu4.nextIndex);
|
|
5775
|
+
dump([_index5], "index");
|
|
5776
|
+
}
|
|
5777
|
+
} else if (bitfield === 4) {
|
|
5778
|
+
var expr = [];
|
|
5779
|
+
parseInstructionBlock(expr);
|
|
5780
|
+
var _countU = readU32();
|
|
5781
|
+
var _count = _countU.value;
|
|
5782
|
+
eatBytes(_countU.nextIndex);
|
|
5783
|
+
dump([_count], "count");
|
|
5784
|
+
for (var _i9 = 0; _i9 < _count; _i9++) {
|
|
5785
|
+
var code = [];
|
|
5786
|
+
parseInstructionBlock(code);
|
|
5787
|
+
}
|
|
5788
|
+
} else if (bitfield === 5) {
|
|
5789
|
+
var reftype = readByte();
|
|
5790
|
+
eatBytes(1);
|
|
5791
|
+
dump([reftype], "reftype");
|
|
5792
|
+
var _countU2 = readU32();
|
|
5793
|
+
var _count2 = _countU2.value;
|
|
5794
|
+
eatBytes(_countU2.nextIndex);
|
|
5795
|
+
dump([_count2], "count");
|
|
5796
|
+
for (var _i10 = 0; _i10 < _count2; _i10++) {
|
|
5797
|
+
var _code = [];
|
|
5798
|
+
parseInstructionBlock(_code);
|
|
5799
|
+
}
|
|
5800
|
+
} else if (bitfield === 7) {
|
|
5801
|
+
var _reftype = readByte();
|
|
5802
|
+
eatBytes(1);
|
|
5803
|
+
dump([_reftype], "reftype");
|
|
5804
|
+
var _countU3 = readU32();
|
|
5805
|
+
var _count3 = _countU3.value;
|
|
5806
|
+
eatBytes(_countU3.nextIndex);
|
|
5807
|
+
dump([_count3], "count");
|
|
5808
|
+
for (var _i11 = 0; _i11 < _count3; _i11++) {
|
|
5809
|
+
var _code2 = [];
|
|
5810
|
+
parseInstructionBlock(_code2);
|
|
5811
|
+
}
|
|
5812
|
+
} else {
|
|
5813
|
+
throw new Error("unexpected Elem with bitfield ".concat(toHex(bitfield)));
|
|
5780
5814
|
}
|
|
5781
|
-
var elemNode = function() {
|
|
5782
|
-
var endLoc = getPosition();
|
|
5783
|
-
return t.withLoc(t.elem(t.indexLiteral(tableindex), instr, indexValues), endLoc, _startLoc12);
|
|
5784
|
-
}();
|
|
5785
|
-
elems.push(elemNode);
|
|
5786
5815
|
}
|
|
5787
5816
|
return elems;
|
|
5788
5817
|
}
|
|
@@ -5816,10 +5845,10 @@ var require_decoder2 = __commonJS({
|
|
|
5816
5845
|
var startFuncIndex = u32.value;
|
|
5817
5846
|
eatBytes(u32.nextIndex);
|
|
5818
5847
|
dump([startFuncIndex], "index");
|
|
5819
|
-
return function() {
|
|
5848
|
+
return (function() {
|
|
5820
5849
|
var endLoc = getPosition();
|
|
5821
5850
|
return t.withLoc(t.start(t.indexLiteral(startFuncIndex)), endLoc, startLoc);
|
|
5822
|
-
}();
|
|
5851
|
+
})();
|
|
5823
5852
|
}
|
|
5824
5853
|
function parseDataSection(numberOfElements) {
|
|
5825
5854
|
var dataEntries = [];
|
|
@@ -5851,8 +5880,7 @@ var require_decoder2 = __commonJS({
|
|
|
5851
5880
|
if (sectionId >= sectionIndex2 || sectionIndex2 === _helperWasmBytecode["default"].sections.custom) {
|
|
5852
5881
|
sectionIndex2 = sectionId + 1;
|
|
5853
5882
|
} else {
|
|
5854
|
-
if (sectionId !== _helperWasmBytecode["default"].sections.custom)
|
|
5855
|
-
throw new _helperApiError.CompileError("Unexpected section: " + toHex(sectionId));
|
|
5883
|
+
if (sectionId !== _helperWasmBytecode["default"].sections.custom) throw new _helperApiError.CompileError("Unexpected section: " + toHex(sectionId));
|
|
5856
5884
|
}
|
|
5857
5885
|
var nextSectionIndex2 = sectionIndex2;
|
|
5858
5886
|
var startOffset = offset;
|
|
@@ -5860,10 +5888,10 @@ var require_decoder2 = __commonJS({
|
|
|
5860
5888
|
var u32 = readU32();
|
|
5861
5889
|
var sectionSizeInBytes = u32.value;
|
|
5862
5890
|
eatBytes(u32.nextIndex);
|
|
5863
|
-
var sectionSizeInBytesNode = function() {
|
|
5891
|
+
var sectionSizeInBytesNode = (function() {
|
|
5864
5892
|
var endLoc = getPosition();
|
|
5865
5893
|
return t.withLoc(t.numberLiteralFromRaw(sectionSizeInBytes), endLoc, startLoc);
|
|
5866
|
-
}();
|
|
5894
|
+
})();
|
|
5867
5895
|
switch (sectionId) {
|
|
5868
5896
|
case _helperWasmBytecode["default"].sections.type: {
|
|
5869
5897
|
dumpSep("section Type");
|
|
@@ -5873,10 +5901,10 @@ var require_decoder2 = __commonJS({
|
|
|
5873
5901
|
var _u = readU32();
|
|
5874
5902
|
var numberOfTypes = _u.value;
|
|
5875
5903
|
eatBytes(_u.nextIndex);
|
|
5876
|
-
var metadata2 = t.sectionMetadata("type", startOffset, sectionSizeInBytesNode, function() {
|
|
5904
|
+
var metadata2 = t.sectionMetadata("type", startOffset, sectionSizeInBytesNode, (function() {
|
|
5877
5905
|
var endLoc = getPosition();
|
|
5878
5906
|
return t.withLoc(t.numberLiteralFromRaw(numberOfTypes), endLoc, _startLoc13);
|
|
5879
|
-
}());
|
|
5907
|
+
})());
|
|
5880
5908
|
var nodes2 = parseTypeSection(numberOfTypes);
|
|
5881
5909
|
return {
|
|
5882
5910
|
nodes: nodes2,
|
|
@@ -5893,10 +5921,10 @@ var require_decoder2 = __commonJS({
|
|
|
5893
5921
|
var numberOfTable = _u2.value;
|
|
5894
5922
|
eatBytes(_u2.nextIndex);
|
|
5895
5923
|
dump([numberOfTable], "num tables");
|
|
5896
|
-
var _metadata = t.sectionMetadata("table", startOffset, sectionSizeInBytesNode, function() {
|
|
5924
|
+
var _metadata = t.sectionMetadata("table", startOffset, sectionSizeInBytesNode, (function() {
|
|
5897
5925
|
var endLoc = getPosition();
|
|
5898
5926
|
return t.withLoc(t.numberLiteralFromRaw(numberOfTable), endLoc, _startLoc14);
|
|
5899
|
-
}());
|
|
5927
|
+
})());
|
|
5900
5928
|
var _nodes = parseTableSection(numberOfTable);
|
|
5901
5929
|
return {
|
|
5902
5930
|
nodes: _nodes,
|
|
@@ -5913,10 +5941,10 @@ var require_decoder2 = __commonJS({
|
|
|
5913
5941
|
var numberOfImports = numberOfImportsu32.value;
|
|
5914
5942
|
eatBytes(numberOfImportsu32.nextIndex);
|
|
5915
5943
|
dump([numberOfImports], "number of imports");
|
|
5916
|
-
var _metadata2 = t.sectionMetadata("import", startOffset, sectionSizeInBytesNode, function() {
|
|
5944
|
+
var _metadata2 = t.sectionMetadata("import", startOffset, sectionSizeInBytesNode, (function() {
|
|
5917
5945
|
var endLoc = getPosition();
|
|
5918
5946
|
return t.withLoc(t.numberLiteralFromRaw(numberOfImports), endLoc, _startLoc15);
|
|
5919
|
-
}());
|
|
5947
|
+
})());
|
|
5920
5948
|
var _nodes2 = parseImportSection(numberOfImports);
|
|
5921
5949
|
return {
|
|
5922
5950
|
nodes: _nodes2,
|
|
@@ -5932,10 +5960,10 @@ var require_decoder2 = __commonJS({
|
|
|
5932
5960
|
var numberOfFunctionsu32 = readU32();
|
|
5933
5961
|
var numberOfFunctions = numberOfFunctionsu32.value;
|
|
5934
5962
|
eatBytes(numberOfFunctionsu32.nextIndex);
|
|
5935
|
-
var _metadata3 = t.sectionMetadata("func", startOffset, sectionSizeInBytesNode, function() {
|
|
5963
|
+
var _metadata3 = t.sectionMetadata("func", startOffset, sectionSizeInBytesNode, (function() {
|
|
5936
5964
|
var endLoc = getPosition();
|
|
5937
5965
|
return t.withLoc(t.numberLiteralFromRaw(numberOfFunctions), endLoc, _startLoc16);
|
|
5938
|
-
}());
|
|
5966
|
+
})());
|
|
5939
5967
|
parseFuncSection(numberOfFunctions);
|
|
5940
5968
|
var _nodes3 = [];
|
|
5941
5969
|
return {
|
|
@@ -5952,10 +5980,10 @@ var require_decoder2 = __commonJS({
|
|
|
5952
5980
|
var _u3 = readU32();
|
|
5953
5981
|
var numberOfExport = _u3.value;
|
|
5954
5982
|
eatBytes(_u3.nextIndex);
|
|
5955
|
-
var _metadata4 = t.sectionMetadata("export", startOffset, sectionSizeInBytesNode, function() {
|
|
5983
|
+
var _metadata4 = t.sectionMetadata("export", startOffset, sectionSizeInBytesNode, (function() {
|
|
5956
5984
|
var endLoc = getPosition();
|
|
5957
5985
|
return t.withLoc(t.numberLiteralFromRaw(numberOfExport), endLoc, _startLoc17);
|
|
5958
|
-
}());
|
|
5986
|
+
})());
|
|
5959
5987
|
parseExportSection(numberOfExport);
|
|
5960
5988
|
var _nodes4 = [];
|
|
5961
5989
|
return {
|
|
@@ -5972,10 +6000,10 @@ var require_decoder2 = __commonJS({
|
|
|
5972
6000
|
var _u4 = readU32();
|
|
5973
6001
|
var numberOfFuncs = _u4.value;
|
|
5974
6002
|
eatBytes(_u4.nextIndex);
|
|
5975
|
-
var _metadata5 = t.sectionMetadata("code", startOffset, sectionSizeInBytesNode, function() {
|
|
6003
|
+
var _metadata5 = t.sectionMetadata("code", startOffset, sectionSizeInBytesNode, (function() {
|
|
5976
6004
|
var endLoc = getPosition();
|
|
5977
6005
|
return t.withLoc(t.numberLiteralFromRaw(numberOfFuncs), endLoc, _startLoc18);
|
|
5978
|
-
}());
|
|
6006
|
+
})());
|
|
5979
6007
|
if (opts.ignoreCodeSection === true) {
|
|
5980
6008
|
var remainingBytes = sectionSizeInBytes - _u4.nextIndex;
|
|
5981
6009
|
eatBytes(remainingBytes);
|
|
@@ -6009,10 +6037,10 @@ var require_decoder2 = __commonJS({
|
|
|
6009
6037
|
var numberOfElementsu32 = readU32();
|
|
6010
6038
|
var numberOfElements = numberOfElementsu32.value;
|
|
6011
6039
|
eatBytes(numberOfElementsu32.nextIndex);
|
|
6012
|
-
var _metadata7 = t.sectionMetadata("element", startOffset, sectionSizeInBytesNode, function() {
|
|
6040
|
+
var _metadata7 = t.sectionMetadata("element", startOffset, sectionSizeInBytesNode, (function() {
|
|
6013
6041
|
var endLoc = getPosition();
|
|
6014
6042
|
return t.withLoc(t.numberLiteralFromRaw(numberOfElements), endLoc, _startLoc19);
|
|
6015
|
-
}());
|
|
6043
|
+
})());
|
|
6016
6044
|
var _nodes7 = parseElemSection(numberOfElements);
|
|
6017
6045
|
return {
|
|
6018
6046
|
nodes: _nodes7,
|
|
@@ -6028,10 +6056,10 @@ var require_decoder2 = __commonJS({
|
|
|
6028
6056
|
var numberOfGlobalsu32 = readU32();
|
|
6029
6057
|
var numberOfGlobals = numberOfGlobalsu32.value;
|
|
6030
6058
|
eatBytes(numberOfGlobalsu32.nextIndex);
|
|
6031
|
-
var _metadata8 = t.sectionMetadata("global", startOffset, sectionSizeInBytesNode, function() {
|
|
6059
|
+
var _metadata8 = t.sectionMetadata("global", startOffset, sectionSizeInBytesNode, (function() {
|
|
6032
6060
|
var endLoc = getPosition();
|
|
6033
6061
|
return t.withLoc(t.numberLiteralFromRaw(numberOfGlobals), endLoc, _startLoc20);
|
|
6034
|
-
}());
|
|
6062
|
+
})());
|
|
6035
6063
|
var _nodes8 = parseGlobalSection(numberOfGlobals);
|
|
6036
6064
|
return {
|
|
6037
6065
|
nodes: _nodes8,
|
|
@@ -6047,10 +6075,10 @@ var require_decoder2 = __commonJS({
|
|
|
6047
6075
|
var _numberOfElementsu = readU32();
|
|
6048
6076
|
var _numberOfElements = _numberOfElementsu.value;
|
|
6049
6077
|
eatBytes(_numberOfElementsu.nextIndex);
|
|
6050
|
-
var _metadata9 = t.sectionMetadata("memory", startOffset, sectionSizeInBytesNode, function() {
|
|
6078
|
+
var _metadata9 = t.sectionMetadata("memory", startOffset, sectionSizeInBytesNode, (function() {
|
|
6051
6079
|
var endLoc = getPosition();
|
|
6052
6080
|
return t.withLoc(t.numberLiteralFromRaw(_numberOfElements), endLoc, _startLoc21);
|
|
6053
|
-
}());
|
|
6081
|
+
})());
|
|
6054
6082
|
var _nodes9 = parseMemorySection(_numberOfElements);
|
|
6055
6083
|
return {
|
|
6056
6084
|
nodes: _nodes9,
|
|
@@ -6067,10 +6095,10 @@ var require_decoder2 = __commonJS({
|
|
|
6067
6095
|
var _numberOfElementsu2 = readU32();
|
|
6068
6096
|
var _numberOfElements2 = _numberOfElementsu2.value;
|
|
6069
6097
|
eatBytes(_numberOfElementsu2.nextIndex);
|
|
6070
|
-
_metadata10.vectorOfSize = function() {
|
|
6098
|
+
_metadata10.vectorOfSize = (function() {
|
|
6071
6099
|
var endLoc = getPosition();
|
|
6072
6100
|
return t.withLoc(t.numberLiteralFromRaw(_numberOfElements2), endLoc, _startLoc22);
|
|
6073
|
-
}();
|
|
6101
|
+
})();
|
|
6074
6102
|
if (opts.ignoreDataSection === true) {
|
|
6075
6103
|
var _remainingBytes = sectionSizeInBytes - _numberOfElementsu2.nextIndex;
|
|
6076
6104
|
eatBytes(_remainingBytes);
|
|
@@ -6140,6 +6168,24 @@ var require_decoder2 = __commonJS({
|
|
|
6140
6168
|
};
|
|
6141
6169
|
}
|
|
6142
6170
|
}
|
|
6171
|
+
function parseBlockType() {
|
|
6172
|
+
var blocktypeByte = readByte();
|
|
6173
|
+
var blocktype = _helperWasmBytecode["default"].blockTypes[blocktypeByte];
|
|
6174
|
+
if (typeof blocktype !== "undefined") {
|
|
6175
|
+
eatBytes(1);
|
|
6176
|
+
dump([blocktypeByte], "blocktype");
|
|
6177
|
+
return blocktype;
|
|
6178
|
+
} else {
|
|
6179
|
+
var u32 = readU32();
|
|
6180
|
+
eatBytes(u32.nextIndex);
|
|
6181
|
+
var signature = state.typesInModule[u32.value];
|
|
6182
|
+
console.log({
|
|
6183
|
+
signature
|
|
6184
|
+
});
|
|
6185
|
+
dump([u32.value], "typeidx");
|
|
6186
|
+
return u32.value;
|
|
6187
|
+
}
|
|
6188
|
+
}
|
|
6143
6189
|
parseModuleHeader();
|
|
6144
6190
|
parseVersion();
|
|
6145
6191
|
var moduleFields = [];
|
|
@@ -6209,10 +6255,8 @@ var require_decoder2 = __commonJS({
|
|
|
6209
6255
|
}
|
|
6210
6256
|
}
|
|
6211
6257
|
});
|
|
6212
|
-
|
|
6213
|
-
// node_modules/.pnpm/@webassemblyjs+wasm-parser@1.12.1/node_modules/@webassemblyjs/wasm-parser/lib/index.js
|
|
6214
6258
|
var require_lib9 = __commonJS({
|
|
6215
|
-
"node_modules/.pnpm/@webassemblyjs+wasm-parser@1.
|
|
6259
|
+
"node_modules/.pnpm/@webassemblyjs+wasm-parser@1.14.1/node_modules/@webassemblyjs/wasm-parser/lib/index.js"(exports) {
|
|
6216
6260
|
function _typeof(obj) {
|
|
6217
6261
|
"@babel/helpers - typeof";
|
|
6218
6262
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
@@ -6233,8 +6277,7 @@ var require_lib9 = __commonJS({
|
|
|
6233
6277
|
var decoder = _interopRequireWildcard(require_decoder2());
|
|
6234
6278
|
var t = _interopRequireWildcard(require_lib7());
|
|
6235
6279
|
function _getRequireWildcardCache(nodeInterop) {
|
|
6236
|
-
if (typeof WeakMap !== "function")
|
|
6237
|
-
return null;
|
|
6280
|
+
if (typeof WeakMap !== "function") return null;
|
|
6238
6281
|
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
|
|
6239
6282
|
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
|
6240
6283
|
return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
|
|
@@ -6242,7 +6285,7 @@ var require_lib9 = __commonJS({
|
|
|
6242
6285
|
})(nodeInterop);
|
|
6243
6286
|
}
|
|
6244
6287
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
6245
|
-
if (
|
|
6288
|
+
if (obj && obj.__esModule) {
|
|
6246
6289
|
return obj;
|
|
6247
6290
|
}
|
|
6248
6291
|
if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
|
|
@@ -6291,7 +6334,7 @@ var require_lib9 = __commonJS({
|
|
|
6291
6334
|
return;
|
|
6292
6335
|
}
|
|
6293
6336
|
t.traverse(ast, {
|
|
6294
|
-
Func: function(_Func) {
|
|
6337
|
+
Func: (function(_Func) {
|
|
6295
6338
|
function Func(_x) {
|
|
6296
6339
|
return _Func.apply(this, arguments);
|
|
6297
6340
|
}
|
|
@@ -6299,7 +6342,7 @@ var require_lib9 = __commonJS({
|
|
|
6299
6342
|
return _Func.toString();
|
|
6300
6343
|
};
|
|
6301
6344
|
return Func;
|
|
6302
|
-
}(function(_ref2) {
|
|
6345
|
+
})(function(_ref2) {
|
|
6303
6346
|
var node = _ref2.node;
|
|
6304
6347
|
var nodeName = node.name;
|
|
6305
6348
|
var indexBasedFunctionName = nodeName.value;
|
|
@@ -6315,7 +6358,7 @@ var require_lib9 = __commonJS({
|
|
|
6315
6358
|
}
|
|
6316
6359
|
}),
|
|
6317
6360
|
// Also update the reference in the export
|
|
6318
|
-
ModuleExport: function(_ModuleExport) {
|
|
6361
|
+
ModuleExport: (function(_ModuleExport) {
|
|
6319
6362
|
function ModuleExport(_x2) {
|
|
6320
6363
|
return _ModuleExport.apply(this, arguments);
|
|
6321
6364
|
}
|
|
@@ -6323,7 +6366,7 @@ var require_lib9 = __commonJS({
|
|
|
6323
6366
|
return _ModuleExport.toString();
|
|
6324
6367
|
};
|
|
6325
6368
|
return ModuleExport;
|
|
6326
|
-
}(function(_ref3) {
|
|
6369
|
+
})(function(_ref3) {
|
|
6327
6370
|
var node = _ref3.node;
|
|
6328
6371
|
if (node.descr.exportType === "Func") {
|
|
6329
6372
|
var nodeName = node.descr.id;
|
|
@@ -6336,7 +6379,7 @@ var require_lib9 = __commonJS({
|
|
|
6336
6379
|
}
|
|
6337
6380
|
}
|
|
6338
6381
|
}),
|
|
6339
|
-
ModuleImport: function(_ModuleImport) {
|
|
6382
|
+
ModuleImport: (function(_ModuleImport) {
|
|
6340
6383
|
function ModuleImport(_x3) {
|
|
6341
6384
|
return _ModuleImport.apply(this, arguments);
|
|
6342
6385
|
}
|
|
@@ -6344,7 +6387,7 @@ var require_lib9 = __commonJS({
|
|
|
6344
6387
|
return _ModuleImport.toString();
|
|
6345
6388
|
};
|
|
6346
6389
|
return ModuleImport;
|
|
6347
|
-
}(function(_ref4) {
|
|
6390
|
+
})(function(_ref4) {
|
|
6348
6391
|
var node = _ref4.node;
|
|
6349
6392
|
if (node.descr.type === "FuncImportDescr") {
|
|
6350
6393
|
var indexBasedFunctionName = node.descr.id;
|
|
@@ -6357,7 +6400,7 @@ var require_lib9 = __commonJS({
|
|
|
6357
6400
|
}
|
|
6358
6401
|
}
|
|
6359
6402
|
}),
|
|
6360
|
-
CallInstruction: function(_CallInstruction) {
|
|
6403
|
+
CallInstruction: (function(_CallInstruction) {
|
|
6361
6404
|
function CallInstruction(_x4) {
|
|
6362
6405
|
return _CallInstruction.apply(this, arguments);
|
|
6363
6406
|
}
|
|
@@ -6365,7 +6408,7 @@ var require_lib9 = __commonJS({
|
|
|
6365
6408
|
return _CallInstruction.toString();
|
|
6366
6409
|
};
|
|
6367
6410
|
return CallInstruction;
|
|
6368
|
-
}(function(nodePath) {
|
|
6411
|
+
})(function(nodePath) {
|
|
6369
6412
|
var node = nodePath.node;
|
|
6370
6413
|
var index = node.index.value;
|
|
6371
6414
|
var functionName = functionNames.find(function(f) {
|
|
@@ -6396,7 +6439,7 @@ var require_lib9 = __commonJS({
|
|
|
6396
6439
|
return;
|
|
6397
6440
|
}
|
|
6398
6441
|
t.traverse(ast, {
|
|
6399
|
-
Func: function(_Func2) {
|
|
6442
|
+
Func: (function(_Func2) {
|
|
6400
6443
|
function Func(_x5) {
|
|
6401
6444
|
return _Func2.apply(this, arguments);
|
|
6402
6445
|
}
|
|
@@ -6404,7 +6447,7 @@ var require_lib9 = __commonJS({
|
|
|
6404
6447
|
return _Func2.toString();
|
|
6405
6448
|
};
|
|
6406
6449
|
return Func;
|
|
6407
|
-
}(function(_ref6) {
|
|
6450
|
+
})(function(_ref6) {
|
|
6408
6451
|
var node = _ref6.node;
|
|
6409
6452
|
var signature = node.signature;
|
|
6410
6453
|
if (signature.type !== "Signature") {
|
|
@@ -6426,7 +6469,7 @@ var require_lib9 = __commonJS({
|
|
|
6426
6469
|
}
|
|
6427
6470
|
function restoreModuleName(ast) {
|
|
6428
6471
|
t.traverse(ast, {
|
|
6429
|
-
ModuleNameMetadata: function(_ModuleNameMetadata) {
|
|
6472
|
+
ModuleNameMetadata: (function(_ModuleNameMetadata) {
|
|
6430
6473
|
function ModuleNameMetadata(_x6) {
|
|
6431
6474
|
return _ModuleNameMetadata.apply(this, arguments);
|
|
6432
6475
|
}
|
|
@@ -6434,9 +6477,9 @@ var require_lib9 = __commonJS({
|
|
|
6434
6477
|
return _ModuleNameMetadata.toString();
|
|
6435
6478
|
};
|
|
6436
6479
|
return ModuleNameMetadata;
|
|
6437
|
-
}(function(moduleNameMetadataPath) {
|
|
6480
|
+
})(function(moduleNameMetadataPath) {
|
|
6438
6481
|
t.traverse(ast, {
|
|
6439
|
-
Module: function(_Module) {
|
|
6482
|
+
Module: (function(_Module) {
|
|
6440
6483
|
function Module(_x7) {
|
|
6441
6484
|
return _Module.apply(this, arguments);
|
|
6442
6485
|
}
|
|
@@ -6444,7 +6487,7 @@ var require_lib9 = __commonJS({
|
|
|
6444
6487
|
return _Module.toString();
|
|
6445
6488
|
};
|
|
6446
6489
|
return Module;
|
|
6447
|
-
}(function(_ref7) {
|
|
6490
|
+
})(function(_ref7) {
|
|
6448
6491
|
var node = _ref7.node;
|
|
6449
6492
|
var name = moduleNameMetadataPath.node.value;
|
|
6450
6493
|
if (name === "") {
|
|
@@ -6468,9 +6511,7 @@ var require_lib9 = __commonJS({
|
|
|
6468
6511
|
}
|
|
6469
6512
|
}
|
|
6470
6513
|
});
|
|
6471
|
-
|
|
6472
|
-
// lib/wasm-parser.in.mjs
|
|
6473
|
-
var import_wasm_parser = __toESM(require_lib9(), 1);
|
|
6514
|
+
var import_wasm_parser = __toESM(require_lib9());
|
|
6474
6515
|
var export_decode = import_wasm_parser.decode;
|
|
6475
6516
|
|
|
6476
6517
|
function parseWasm(source, opts = {}) {
|