unwasm 0.3.9 → 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 +6 -3
- 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 +358 -334
- 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 +358 -334
- package/package.json +33 -33
package/dist/tools.mjs
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// webassemblyjs (MIT) - Copyright (c) 2018 Sven Sauleau <sven@sauleau.com>
|
|
2
|
-
|
|
3
1
|
var __create = Object.create;
|
|
4
2
|
var __defProp = Object.defineProperty;
|
|
5
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -22,13 +20,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
20
|
// file that has been converted to a CommonJS file using a Babel-
|
|
23
21
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
22
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
|
|
23
|
+
__defProp(target, "default", { value: mod, enumerable: true }) ,
|
|
26
24
|
mod
|
|
27
25
|
));
|
|
28
|
-
|
|
29
|
-
// node_modules/.pnpm/@webassemblyjs+helper-api-error@1.11.6/node_modules/@webassemblyjs/helper-api-error/lib/index.js
|
|
30
26
|
var require_lib = __commonJS({
|
|
31
|
-
"node_modules/.pnpm/@webassemblyjs+helper-api-error@1.
|
|
27
|
+
"node_modules/.pnpm/@webassemblyjs+helper-api-error@1.13.2/node_modules/@webassemblyjs/helper-api-error/lib/index.js"(exports) {
|
|
32
28
|
function _typeof(obj) {
|
|
33
29
|
"@babel/helpers - typeof";
|
|
34
30
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
@@ -56,8 +52,7 @@ var require_lib = __commonJS({
|
|
|
56
52
|
throw new TypeError("Super expression must either be null or a function");
|
|
57
53
|
}
|
|
58
54
|
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
59
|
-
if (superClass)
|
|
60
|
-
_setPrototypeOf(subClass, superClass);
|
|
55
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
61
56
|
}
|
|
62
57
|
function _createSuper(Derived) {
|
|
63
58
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
@@ -89,14 +84,12 @@ var require_lib = __commonJS({
|
|
|
89
84
|
function _wrapNativeSuper(Class) {
|
|
90
85
|
var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
91
86
|
_wrapNativeSuper = function _wrapNativeSuper2(Class2) {
|
|
92
|
-
if (Class2 === null || !_isNativeFunction(Class2))
|
|
93
|
-
return Class2;
|
|
87
|
+
if (Class2 === null || !_isNativeFunction(Class2)) return Class2;
|
|
94
88
|
if (typeof Class2 !== "function") {
|
|
95
89
|
throw new TypeError("Super expression must either be null or a function");
|
|
96
90
|
}
|
|
97
91
|
if (typeof _cache !== "undefined") {
|
|
98
|
-
if (_cache.has(Class2))
|
|
99
|
-
return _cache.get(Class2);
|
|
92
|
+
if (_cache.has(Class2)) return _cache.get(Class2);
|
|
100
93
|
_cache.set(Class2, Wrapper);
|
|
101
94
|
}
|
|
102
95
|
function Wrapper() {
|
|
@@ -116,20 +109,16 @@ var require_lib = __commonJS({
|
|
|
116
109
|
a.push.apply(a, args2);
|
|
117
110
|
var Constructor = Function.bind.apply(Parent2, a);
|
|
118
111
|
var instance = new Constructor();
|
|
119
|
-
if (Class2)
|
|
120
|
-
_setPrototypeOf(instance, Class2.prototype);
|
|
112
|
+
if (Class2) _setPrototypeOf(instance, Class2.prototype);
|
|
121
113
|
return instance;
|
|
122
114
|
};
|
|
123
115
|
}
|
|
124
116
|
return _construct.apply(null, arguments);
|
|
125
117
|
}
|
|
126
118
|
function _isNativeReflectConstruct() {
|
|
127
|
-
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
128
|
-
|
|
129
|
-
if (
|
|
130
|
-
return false;
|
|
131
|
-
if (typeof Proxy === "function")
|
|
132
|
-
return true;
|
|
119
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
120
|
+
if (Reflect.construct.sham) return false;
|
|
121
|
+
if (typeof Proxy === "function") return true;
|
|
133
122
|
try {
|
|
134
123
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
135
124
|
}));
|
|
@@ -154,7 +143,7 @@ var require_lib = __commonJS({
|
|
|
154
143
|
};
|
|
155
144
|
return _getPrototypeOf(o);
|
|
156
145
|
}
|
|
157
|
-
var RuntimeError = /* @__PURE__ */ function(_Error) {
|
|
146
|
+
var RuntimeError = /* @__PURE__ */ (function(_Error) {
|
|
158
147
|
_inherits(RuntimeError2, _Error);
|
|
159
148
|
var _super = _createSuper(RuntimeError2);
|
|
160
149
|
function RuntimeError2() {
|
|
@@ -162,9 +151,9 @@ var require_lib = __commonJS({
|
|
|
162
151
|
return _super.apply(this, arguments);
|
|
163
152
|
}
|
|
164
153
|
return RuntimeError2;
|
|
165
|
-
}(/* @__PURE__ */ _wrapNativeSuper(Error));
|
|
154
|
+
})(/* @__PURE__ */ _wrapNativeSuper(Error));
|
|
166
155
|
exports.RuntimeError = RuntimeError;
|
|
167
|
-
var CompileError = /* @__PURE__ */ function(_Error2) {
|
|
156
|
+
var CompileError = /* @__PURE__ */ (function(_Error2) {
|
|
168
157
|
_inherits(CompileError2, _Error2);
|
|
169
158
|
var _super2 = _createSuper(CompileError2);
|
|
170
159
|
function CompileError2() {
|
|
@@ -172,9 +161,9 @@ var require_lib = __commonJS({
|
|
|
172
161
|
return _super2.apply(this, arguments);
|
|
173
162
|
}
|
|
174
163
|
return CompileError2;
|
|
175
|
-
}(/* @__PURE__ */ _wrapNativeSuper(Error));
|
|
164
|
+
})(/* @__PURE__ */ _wrapNativeSuper(Error));
|
|
176
165
|
exports.CompileError = CompileError;
|
|
177
|
-
var LinkError = /* @__PURE__ */ function(_Error3) {
|
|
166
|
+
var LinkError = /* @__PURE__ */ (function(_Error3) {
|
|
178
167
|
_inherits(LinkError2, _Error3);
|
|
179
168
|
var _super3 = _createSuper(LinkError2);
|
|
180
169
|
function LinkError2() {
|
|
@@ -182,12 +171,10 @@ var require_lib = __commonJS({
|
|
|
182
171
|
return _super3.apply(this, arguments);
|
|
183
172
|
}
|
|
184
173
|
return LinkError2;
|
|
185
|
-
}(/* @__PURE__ */ _wrapNativeSuper(Error));
|
|
174
|
+
})(/* @__PURE__ */ _wrapNativeSuper(Error));
|
|
186
175
|
exports.LinkError = LinkError;
|
|
187
176
|
}
|
|
188
177
|
});
|
|
189
|
-
|
|
190
|
-
// node_modules/.pnpm/@xtuc+ieee754@1.2.0/node_modules/@xtuc/ieee754/dist/index.cjs.js
|
|
191
178
|
var require_index_cjs = __commonJS({
|
|
192
179
|
"node_modules/.pnpm/@xtuc+ieee754@1.2.0/node_modules/@xtuc/ieee754/dist/index.cjs.js"(exports) {
|
|
193
180
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -274,10 +261,8 @@ var require_index_cjs = __commonJS({
|
|
|
274
261
|
}
|
|
275
262
|
}
|
|
276
263
|
});
|
|
277
|
-
|
|
278
|
-
// node_modules/.pnpm/@webassemblyjs+ieee754@1.12.1/node_modules/@webassemblyjs/ieee754/lib/index.js
|
|
279
264
|
var require_lib2 = __commonJS({
|
|
280
|
-
"node_modules/.pnpm/@webassemblyjs+ieee754@1.
|
|
265
|
+
"node_modules/.pnpm/@webassemblyjs+ieee754@1.14.1/node_modules/@webassemblyjs/ieee754/lib/index.js"(exports) {
|
|
281
266
|
Object.defineProperty(exports, "__esModule", {
|
|
282
267
|
value: true
|
|
283
268
|
});
|
|
@@ -315,10 +300,8 @@ var require_lib2 = __commonJS({
|
|
|
315
300
|
}
|
|
316
301
|
}
|
|
317
302
|
});
|
|
318
|
-
|
|
319
|
-
// node_modules/.pnpm/@webassemblyjs+utf8@1.12.1/node_modules/@webassemblyjs/utf8/lib/decoder.js
|
|
320
303
|
var require_decoder = __commonJS({
|
|
321
|
-
"node_modules/.pnpm/@webassemblyjs+utf8@1.
|
|
304
|
+
"node_modules/.pnpm/@webassemblyjs+utf8@1.14.1/node_modules/@webassemblyjs/utf8/lib/decoder.js"(exports) {
|
|
322
305
|
Object.defineProperty(exports, "__esModule", {
|
|
323
306
|
value: true
|
|
324
307
|
});
|
|
@@ -378,10 +361,8 @@ var require_decoder = __commonJS({
|
|
|
378
361
|
}
|
|
379
362
|
}
|
|
380
363
|
});
|
|
381
|
-
|
|
382
|
-
// node_modules/.pnpm/@webassemblyjs+utf8@1.12.1/node_modules/@webassemblyjs/utf8/lib/encoder.js
|
|
383
364
|
var require_encoder = __commonJS({
|
|
384
|
-
"node_modules/.pnpm/@webassemblyjs+utf8@1.
|
|
365
|
+
"node_modules/.pnpm/@webassemblyjs+utf8@1.14.1/node_modules/@webassemblyjs/utf8/lib/encoder.js"(exports) {
|
|
385
366
|
Object.defineProperty(exports, "__esModule", {
|
|
386
367
|
value: true
|
|
387
368
|
});
|
|
@@ -393,8 +374,7 @@ var require_encoder = __commonJS({
|
|
|
393
374
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
394
375
|
}
|
|
395
376
|
function _arrayWithoutHoles(arr) {
|
|
396
|
-
if (Array.isArray(arr))
|
|
397
|
-
return _arrayLikeToArray(arr);
|
|
377
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
398
378
|
}
|
|
399
379
|
function _toArray(arr) {
|
|
400
380
|
return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
|
|
@@ -403,33 +383,25 @@ var require_encoder = __commonJS({
|
|
|
403
383
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
404
384
|
}
|
|
405
385
|
function _unsupportedIterableToArray(o, minLen) {
|
|
406
|
-
if (!o)
|
|
407
|
-
|
|
408
|
-
if (typeof o === "string")
|
|
409
|
-
return _arrayLikeToArray(o, minLen);
|
|
386
|
+
if (!o) return;
|
|
387
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
410
388
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
411
|
-
if (n === "Object" && o.constructor)
|
|
412
|
-
|
|
413
|
-
if (n === "
|
|
414
|
-
return Array.from(o);
|
|
415
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
416
|
-
return _arrayLikeToArray(o, minLen);
|
|
389
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
390
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
391
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
417
392
|
}
|
|
418
393
|
function _arrayLikeToArray(arr, len) {
|
|
419
|
-
if (len == null || len > arr.length)
|
|
420
|
-
len = arr.length;
|
|
394
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
421
395
|
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
422
396
|
arr2[i] = arr[i];
|
|
423
397
|
}
|
|
424
398
|
return arr2;
|
|
425
399
|
}
|
|
426
400
|
function _iterableToArray(iter) {
|
|
427
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
428
|
-
return Array.from(iter);
|
|
401
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
429
402
|
}
|
|
430
403
|
function _arrayWithHoles(arr) {
|
|
431
|
-
if (Array.isArray(arr))
|
|
432
|
-
return arr;
|
|
404
|
+
if (Array.isArray(arr)) return arr;
|
|
433
405
|
}
|
|
434
406
|
function con(n) {
|
|
435
407
|
return 128 | n & 63;
|
|
@@ -464,10 +436,8 @@ var require_encoder = __commonJS({
|
|
|
464
436
|
}
|
|
465
437
|
}
|
|
466
438
|
});
|
|
467
|
-
|
|
468
|
-
// node_modules/.pnpm/@webassemblyjs+utf8@1.12.1/node_modules/@webassemblyjs/utf8/lib/index.js
|
|
469
439
|
var require_lib3 = __commonJS({
|
|
470
|
-
"node_modules/.pnpm/@webassemblyjs+utf8@1.
|
|
440
|
+
"node_modules/.pnpm/@webassemblyjs+utf8@1.14.1/node_modules/@webassemblyjs/utf8/lib/index.js"(exports) {
|
|
471
441
|
Object.defineProperty(exports, "__esModule", {
|
|
472
442
|
value: true
|
|
473
443
|
});
|
|
@@ -487,10 +457,8 @@ var require_lib3 = __commonJS({
|
|
|
487
457
|
var _encoder = require_encoder();
|
|
488
458
|
}
|
|
489
459
|
});
|
|
490
|
-
|
|
491
|
-
// node_modules/.pnpm/@webassemblyjs+ast@1.12.1/node_modules/@webassemblyjs/ast/lib/nodes.js
|
|
492
460
|
var require_nodes = __commonJS({
|
|
493
|
-
"node_modules/.pnpm/@webassemblyjs+ast@1.
|
|
461
|
+
"node_modules/.pnpm/@webassemblyjs+ast@1.14.1/node_modules/@webassemblyjs/ast/lib/nodes.js"(exports) {
|
|
494
462
|
Object.defineProperty(exports, "__esModule", {
|
|
495
463
|
value: true
|
|
496
464
|
});
|
|
@@ -563,11 +531,11 @@ var require_nodes = __commonJS({
|
|
|
563
531
|
}
|
|
564
532
|
function assertTypeOf(t) {
|
|
565
533
|
return function(n) {
|
|
566
|
-
return function() {
|
|
534
|
+
return (function() {
|
|
567
535
|
if (!(n.type === t)) {
|
|
568
536
|
throw new Error("n.type === t error: unknown");
|
|
569
537
|
}
|
|
570
|
-
}();
|
|
538
|
+
})();
|
|
571
539
|
};
|
|
572
540
|
}
|
|
573
541
|
function _module(id, fields, metadata) {
|
|
@@ -1489,8 +1457,6 @@ var require_nodes = __commonJS({
|
|
|
1489
1457
|
exports.nodeAndUnionTypes = nodeAndUnionTypes;
|
|
1490
1458
|
}
|
|
1491
1459
|
});
|
|
1492
|
-
|
|
1493
|
-
// node_modules/.pnpm/@xtuc+long@4.2.2/node_modules/@xtuc/long/src/long.js
|
|
1494
1460
|
var require_long = __commonJS({
|
|
1495
1461
|
"node_modules/.pnpm/@xtuc+long@4.2.2/node_modules/@xtuc/long/src/long.js"(exports, module) {
|
|
1496
1462
|
module.exports = Long;
|
|
@@ -2276,26 +2242,19 @@ var require_long = __commonJS({
|
|
|
2276
2242
|
};
|
|
2277
2243
|
LongPrototype.shr = LongPrototype.shiftRight;
|
|
2278
2244
|
LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {
|
|
2279
|
-
if (isLong(numBits))
|
|
2280
|
-
|
|
2281
|
-
if (
|
|
2282
|
-
|
|
2283
|
-
if (numBits < 32)
|
|
2284
|
-
return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >>> numBits, this.unsigned);
|
|
2285
|
-
if (numBits === 32)
|
|
2286
|
-
return fromBits(this.high, 0, this.unsigned);
|
|
2245
|
+
if (isLong(numBits)) numBits = numBits.toInt();
|
|
2246
|
+
if ((numBits &= 63) === 0) return this;
|
|
2247
|
+
if (numBits < 32) return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >>> numBits, this.unsigned);
|
|
2248
|
+
if (numBits === 32) return fromBits(this.high, 0, this.unsigned);
|
|
2287
2249
|
return fromBits(this.high >>> numBits - 32, 0, this.unsigned);
|
|
2288
2250
|
};
|
|
2289
2251
|
LongPrototype.shru = LongPrototype.shiftRightUnsigned;
|
|
2290
2252
|
LongPrototype.shr_u = LongPrototype.shiftRightUnsigned;
|
|
2291
2253
|
LongPrototype.rotateLeft = function rotateLeft(numBits) {
|
|
2292
2254
|
var b;
|
|
2293
|
-
if (isLong(numBits))
|
|
2294
|
-
|
|
2295
|
-
if (
|
|
2296
|
-
return this;
|
|
2297
|
-
if (numBits === 32)
|
|
2298
|
-
return fromBits(this.high, this.low, this.unsigned);
|
|
2255
|
+
if (isLong(numBits)) numBits = numBits.toInt();
|
|
2256
|
+
if ((numBits &= 63) === 0) return this;
|
|
2257
|
+
if (numBits === 32) return fromBits(this.high, this.low, this.unsigned);
|
|
2299
2258
|
if (numBits < 32) {
|
|
2300
2259
|
b = 32 - numBits;
|
|
2301
2260
|
return fromBits(this.low << numBits | this.high >>> b, this.high << numBits | this.low >>> b, this.unsigned);
|
|
@@ -2307,12 +2266,9 @@ var require_long = __commonJS({
|
|
|
2307
2266
|
LongPrototype.rotl = LongPrototype.rotateLeft;
|
|
2308
2267
|
LongPrototype.rotateRight = function rotateRight(numBits) {
|
|
2309
2268
|
var b;
|
|
2310
|
-
if (isLong(numBits))
|
|
2311
|
-
|
|
2312
|
-
if (
|
|
2313
|
-
return this;
|
|
2314
|
-
if (numBits === 32)
|
|
2315
|
-
return fromBits(this.high, this.low, this.unsigned);
|
|
2269
|
+
if (isLong(numBits)) numBits = numBits.toInt();
|
|
2270
|
+
if ((numBits &= 63) === 0) return this;
|
|
2271
|
+
if (numBits === 32) return fromBits(this.high, this.low, this.unsigned);
|
|
2316
2272
|
if (numBits < 32) {
|
|
2317
2273
|
b = 32 - numBits;
|
|
2318
2274
|
return fromBits(this.high << b | this.low >>> numBits, this.low << b | this.high >>> numBits, this.unsigned);
|
|
@@ -2380,10 +2336,8 @@ var require_long = __commonJS({
|
|
|
2380
2336
|
};
|
|
2381
2337
|
}
|
|
2382
2338
|
});
|
|
2383
|
-
|
|
2384
|
-
// node_modules/.pnpm/@webassemblyjs+floating-point-hex-parser@1.11.6/node_modules/@webassemblyjs/floating-point-hex-parser/lib/index.js
|
|
2385
2339
|
var require_lib4 = __commonJS({
|
|
2386
|
-
"node_modules/.pnpm/@webassemblyjs+floating-point-hex-parser@1.
|
|
2340
|
+
"node_modules/.pnpm/@webassemblyjs+floating-point-hex-parser@1.13.2/node_modules/@webassemblyjs/floating-point-hex-parser/lib/index.js"(exports) {
|
|
2387
2341
|
Object.defineProperty(exports, "__esModule", {
|
|
2388
2342
|
value: true
|
|
2389
2343
|
});
|
|
@@ -2427,10 +2381,8 @@ var require_lib4 = __commonJS({
|
|
|
2427
2381
|
}
|
|
2428
2382
|
}
|
|
2429
2383
|
});
|
|
2430
|
-
|
|
2431
|
-
// node_modules/.pnpm/@webassemblyjs+helper-numbers@1.11.6/node_modules/@webassemblyjs/helper-numbers/lib/index.js
|
|
2432
2384
|
var require_lib5 = __commonJS({
|
|
2433
|
-
"node_modules/.pnpm/@webassemblyjs+helper-numbers@1.
|
|
2385
|
+
"node_modules/.pnpm/@webassemblyjs+helper-numbers@1.13.2/node_modules/@webassemblyjs/helper-numbers/lib/index.js"(exports) {
|
|
2434
2386
|
Object.defineProperty(exports, "__esModule", {
|
|
2435
2387
|
value: true
|
|
2436
2388
|
});
|
|
@@ -2522,10 +2474,8 @@ var require_lib5 = __commonJS({
|
|
|
2522
2474
|
}
|
|
2523
2475
|
}
|
|
2524
2476
|
});
|
|
2525
|
-
|
|
2526
|
-
// node_modules/.pnpm/@webassemblyjs+ast@1.12.1/node_modules/@webassemblyjs/ast/lib/node-helpers.js
|
|
2527
2477
|
var require_node_helpers = __commonJS({
|
|
2528
|
-
"node_modules/.pnpm/@webassemblyjs+ast@1.
|
|
2478
|
+
"node_modules/.pnpm/@webassemblyjs+ast@1.14.1/node_modules/@webassemblyjs/ast/lib/node-helpers.js"(exports) {
|
|
2529
2479
|
Object.defineProperty(exports, "__esModule", {
|
|
2530
2480
|
value: true
|
|
2531
2481
|
});
|
|
@@ -2561,6 +2511,7 @@ var require_node_helpers = __commonJS({
|
|
|
2561
2511
|
case "f32": {
|
|
2562
2512
|
return (0, _nodes.floatLiteral)((0, _helperNumbers.parse32F)(rawValue), (0, _helperNumbers.isNanLiteral)(rawValue), (0, _helperNumbers.isInfLiteral)(rawValue), String(original));
|
|
2563
2513
|
}
|
|
2514
|
+
// f64
|
|
2564
2515
|
default: {
|
|
2565
2516
|
return (0, _nodes.floatLiteral)((0, _helperNumbers.parse64F)(rawValue), (0, _helperNumbers.isNanLiteral)(rawValue), (0, _helperNumbers.isInfLiteral)(rawValue), String(original));
|
|
2566
2517
|
}
|
|
@@ -2605,10 +2556,8 @@ var require_node_helpers = __commonJS({
|
|
|
2605
2556
|
}
|
|
2606
2557
|
}
|
|
2607
2558
|
});
|
|
2608
|
-
|
|
2609
|
-
// node_modules/.pnpm/@webassemblyjs+ast@1.12.1/node_modules/@webassemblyjs/ast/lib/node-path.js
|
|
2610
2559
|
var require_node_path = __commonJS({
|
|
2611
|
-
"node_modules/.pnpm/@webassemblyjs+ast@1.
|
|
2560
|
+
"node_modules/.pnpm/@webassemblyjs+ast@1.14.1/node_modules/@webassemblyjs/ast/lib/node-path.js"(exports) {
|
|
2612
2561
|
Object.defineProperty(exports, "__esModule", {
|
|
2613
2562
|
value: true
|
|
2614
2563
|
});
|
|
@@ -2744,10 +2693,8 @@ var require_node_path = __commonJS({
|
|
|
2744
2693
|
}
|
|
2745
2694
|
}
|
|
2746
2695
|
});
|
|
2747
|
-
|
|
2748
|
-
// node_modules/.pnpm/@webassemblyjs+ast@1.12.1/node_modules/@webassemblyjs/ast/lib/traverse.js
|
|
2749
2696
|
var require_traverse = __commonJS({
|
|
2750
|
-
"node_modules/.pnpm/@webassemblyjs+ast@1.
|
|
2697
|
+
"node_modules/.pnpm/@webassemblyjs+ast@1.14.1/node_modules/@webassemblyjs/ast/lib/traverse.js"(exports) {
|
|
2751
2698
|
Object.defineProperty(exports, "__esModule", {
|
|
2752
2699
|
value: true
|
|
2753
2700
|
});
|
|
@@ -2834,10 +2781,8 @@ var require_traverse = __commonJS({
|
|
|
2834
2781
|
}
|
|
2835
2782
|
}
|
|
2836
2783
|
});
|
|
2837
|
-
|
|
2838
|
-
// node_modules/.pnpm/@webassemblyjs+ast@1.12.1/node_modules/@webassemblyjs/ast/lib/signatures.js
|
|
2839
2784
|
var require_signatures = __commonJS({
|
|
2840
|
-
"node_modules/.pnpm/@webassemblyjs+ast@1.
|
|
2785
|
+
"node_modules/.pnpm/@webassemblyjs+ast@1.14.1/node_modules/@webassemblyjs/ast/lib/signatures.js"(exports) {
|
|
2841
2786
|
Object.defineProperty(exports, "__esModule", {
|
|
2842
2787
|
value: true
|
|
2843
2788
|
});
|
|
@@ -3040,10 +2985,8 @@ var require_signatures = __commonJS({
|
|
|
3040
2985
|
exports.signatures = signatures;
|
|
3041
2986
|
}
|
|
3042
2987
|
});
|
|
3043
|
-
|
|
3044
|
-
// node_modules/.pnpm/@webassemblyjs+helper-wasm-bytecode@1.12.1/node_modules/@webassemblyjs/helper-wasm-bytecode/lib/section.js
|
|
3045
2988
|
var require_section = __commonJS({
|
|
3046
|
-
"node_modules/.pnpm/@webassemblyjs+helper-wasm-bytecode@1.
|
|
2989
|
+
"node_modules/.pnpm/@webassemblyjs+helper-wasm-bytecode@1.14.1/node_modules/@webassemblyjs/helper-wasm-bytecode/lib/section.js"(exports) {
|
|
3047
2990
|
Object.defineProperty(exports, "__esModule", {
|
|
3048
2991
|
value: true
|
|
3049
2992
|
});
|
|
@@ -3067,16 +3010,15 @@ var require_section = __commonJS({
|
|
|
3067
3010
|
return "func";
|
|
3068
3011
|
case "Global":
|
|
3069
3012
|
return "global";
|
|
3013
|
+
// No section
|
|
3070
3014
|
default:
|
|
3071
3015
|
return;
|
|
3072
3016
|
}
|
|
3073
3017
|
}
|
|
3074
3018
|
}
|
|
3075
3019
|
});
|
|
3076
|
-
|
|
3077
|
-
// node_modules/.pnpm/@webassemblyjs+helper-wasm-bytecode@1.12.1/node_modules/@webassemblyjs/helper-wasm-bytecode/lib/index.js
|
|
3078
3020
|
var require_lib6 = __commonJS({
|
|
3079
|
-
"node_modules/.pnpm/@webassemblyjs+helper-wasm-bytecode@1.
|
|
3021
|
+
"node_modules/.pnpm/@webassemblyjs+helper-wasm-bytecode@1.14.1/node_modules/@webassemblyjs/helper-wasm-bytecode/lib/index.js"(exports) {
|
|
3080
3022
|
Object.defineProperty(exports, "__esModule", {
|
|
3081
3023
|
value: true
|
|
3082
3024
|
});
|
|
@@ -3129,15 +3071,21 @@ var require_lib6 = __commonJS({
|
|
|
3129
3071
|
};
|
|
3130
3072
|
var exportTypesByName = invertMap(exportTypes);
|
|
3131
3073
|
var valtypes = {
|
|
3074
|
+
// numtype
|
|
3132
3075
|
127: "i32",
|
|
3133
3076
|
126: "i64",
|
|
3134
3077
|
125: "f32",
|
|
3135
3078
|
124: "f64",
|
|
3136
|
-
|
|
3079
|
+
// vectype
|
|
3080
|
+
123: "v128",
|
|
3081
|
+
// reftype
|
|
3082
|
+
112: "anyfunc",
|
|
3083
|
+
111: "externref"
|
|
3137
3084
|
};
|
|
3138
3085
|
var valtypesByString = invertMap(valtypes);
|
|
3139
3086
|
var tableTypes = {
|
|
3140
|
-
112: "anyfunc"
|
|
3087
|
+
112: "anyfunc",
|
|
3088
|
+
111: "externref"
|
|
3141
3089
|
};
|
|
3142
3090
|
var blockTypes = Object.assign({}, valtypes, {
|
|
3143
3091
|
// https://webassembly.github.io/spec/core/binary/types.html#binary-blocktype
|
|
@@ -3211,8 +3159,8 @@ var require_lib6 = __commonJS({
|
|
|
3211
3159
|
34: createSymbol("tee_local", 1),
|
|
3212
3160
|
35: createSymbol("get_global", 1),
|
|
3213
3161
|
36: createSymbol("set_global", 1),
|
|
3214
|
-
37:
|
|
3215
|
-
38:
|
|
3162
|
+
37: createSymbol("table.get", 1),
|
|
3163
|
+
38: createSymbol("table.set", 1),
|
|
3216
3164
|
39: illegalop,
|
|
3217
3165
|
40: createSymbolObject("load", "u32", 1),
|
|
3218
3166
|
41: createSymbolObject("load", "u64", 1),
|
|
@@ -3371,6 +3319,19 @@ var require_lib6 = __commonJS({
|
|
|
3371
3319
|
194: createSymbolObject("extend8_s", "i64"),
|
|
3372
3320
|
195: createSymbolObject("extend16_s", "i64"),
|
|
3373
3321
|
196: createSymbolObject("extend32_s", "i64"),
|
|
3322
|
+
208: createSymbol("ref.null"),
|
|
3323
|
+
209: createSymbol("ref.is_null"),
|
|
3324
|
+
210: createSymbol("ref.func", 1),
|
|
3325
|
+
64522: createSymbol("memory.copy"),
|
|
3326
|
+
64523: createSymbol("memory.fill"),
|
|
3327
|
+
// Table instructions
|
|
3328
|
+
// https://webassembly.github.io/spec/core/binary/instructions.html#table-instructions
|
|
3329
|
+
64524: createSymbol("table.init", 2),
|
|
3330
|
+
64525: createSymbol("elem.drop", 1),
|
|
3331
|
+
64526: createSymbol("table.copy", 2),
|
|
3332
|
+
64527: createSymbol("table.grow", 1),
|
|
3333
|
+
64528: createSymbol("table.size", 1),
|
|
3334
|
+
64529: createSymbol("table.fill", 1),
|
|
3374
3335
|
// Atomic Memory Instructions
|
|
3375
3336
|
65024: createSymbol("memory.atomic.notify", 1),
|
|
3376
3337
|
65025: createSymbol("memory.atomic.wait32", 1),
|
|
@@ -3465,10 +3426,8 @@ var require_lib6 = __commonJS({
|
|
|
3465
3426
|
exports["default"] = _default;
|
|
3466
3427
|
}
|
|
3467
3428
|
});
|
|
3468
|
-
|
|
3469
|
-
// node_modules/.pnpm/@webassemblyjs+ast@1.12.1/node_modules/@webassemblyjs/ast/lib/utils.js
|
|
3470
3429
|
var require_utils = __commonJS({
|
|
3471
|
-
"node_modules/.pnpm/@webassemblyjs+ast@1.
|
|
3430
|
+
"node_modules/.pnpm/@webassemblyjs+ast@1.14.1/node_modules/@webassemblyjs/ast/lib/utils.js"(exports) {
|
|
3472
3431
|
Object.defineProperty(exports, "__esModule", {
|
|
3473
3432
|
value: true
|
|
3474
3433
|
});
|
|
@@ -3492,8 +3451,7 @@ var require_utils = __commonJS({
|
|
|
3492
3451
|
var _traverse = require_traverse();
|
|
3493
3452
|
var _helperWasmBytecode = _interopRequireWildcard(require_lib6());
|
|
3494
3453
|
function _getRequireWildcardCache(nodeInterop) {
|
|
3495
|
-
if (typeof WeakMap !== "function")
|
|
3496
|
-
return null;
|
|
3454
|
+
if (typeof WeakMap !== "function") return null;
|
|
3497
3455
|
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
|
|
3498
3456
|
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
|
3499
3457
|
return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
|
|
@@ -3501,7 +3459,7 @@ var require_utils = __commonJS({
|
|
|
3501
3459
|
})(nodeInterop);
|
|
3502
3460
|
}
|
|
3503
3461
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
3504
|
-
if (
|
|
3462
|
+
if (obj && obj.__esModule) {
|
|
3505
3463
|
return obj;
|
|
3506
3464
|
}
|
|
3507
3465
|
if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
|
|
@@ -3536,21 +3494,15 @@ var require_utils = __commonJS({
|
|
|
3536
3494
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3537
3495
|
}
|
|
3538
3496
|
function _unsupportedIterableToArray(o, minLen) {
|
|
3539
|
-
if (!o)
|
|
3540
|
-
|
|
3541
|
-
if (typeof o === "string")
|
|
3542
|
-
return _arrayLikeToArray(o, minLen);
|
|
3497
|
+
if (!o) return;
|
|
3498
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
3543
3499
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
3544
|
-
if (n === "Object" && o.constructor)
|
|
3545
|
-
|
|
3546
|
-
if (n === "
|
|
3547
|
-
return Array.from(o);
|
|
3548
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
3549
|
-
return _arrayLikeToArray(o, minLen);
|
|
3500
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
3501
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
3502
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
3550
3503
|
}
|
|
3551
3504
|
function _arrayLikeToArray(arr, len) {
|
|
3552
|
-
if (len == null || len > arr.length)
|
|
3553
|
-
len = arr.length;
|
|
3505
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3554
3506
|
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
3555
3507
|
arr2[i] = arr[i];
|
|
3556
3508
|
}
|
|
@@ -3558,8 +3510,7 @@ var require_utils = __commonJS({
|
|
|
3558
3510
|
}
|
|
3559
3511
|
function _iterableToArrayLimit(arr, i) {
|
|
3560
3512
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3561
|
-
if (_i == null)
|
|
3562
|
-
return;
|
|
3513
|
+
if (_i == null) return;
|
|
3563
3514
|
var _arr = [];
|
|
3564
3515
|
var _n = true;
|
|
3565
3516
|
var _d = false;
|
|
@@ -3567,26 +3518,22 @@ var require_utils = __commonJS({
|
|
|
3567
3518
|
try {
|
|
3568
3519
|
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
3569
3520
|
_arr.push(_s.value);
|
|
3570
|
-
if (i && _arr.length === i)
|
|
3571
|
-
break;
|
|
3521
|
+
if (i && _arr.length === i) break;
|
|
3572
3522
|
}
|
|
3573
3523
|
} catch (err) {
|
|
3574
3524
|
_d = true;
|
|
3575
3525
|
_e = err;
|
|
3576
3526
|
} finally {
|
|
3577
3527
|
try {
|
|
3578
|
-
if (!_n && _i["return"] != null)
|
|
3579
|
-
_i["return"]();
|
|
3528
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
3580
3529
|
} finally {
|
|
3581
|
-
if (_d)
|
|
3582
|
-
throw _e;
|
|
3530
|
+
if (_d) throw _e;
|
|
3583
3531
|
}
|
|
3584
3532
|
}
|
|
3585
3533
|
return _arr;
|
|
3586
3534
|
}
|
|
3587
3535
|
function _arrayWithHoles(arr) {
|
|
3588
|
-
if (Array.isArray(arr))
|
|
3589
|
-
return arr;
|
|
3536
|
+
if (Array.isArray(arr)) return arr;
|
|
3590
3537
|
}
|
|
3591
3538
|
function _typeof(obj) {
|
|
3592
3539
|
"@babel/helpers - typeof";
|
|
@@ -3607,7 +3554,7 @@ var require_utils = __commonJS({
|
|
|
3607
3554
|
function getSectionMetadata(ast, name) {
|
|
3608
3555
|
var section;
|
|
3609
3556
|
(0, _traverse.traverse)(ast, {
|
|
3610
|
-
SectionMetadata: function(_SectionMetadata) {
|
|
3557
|
+
SectionMetadata: (function(_SectionMetadata) {
|
|
3611
3558
|
function SectionMetadata(_x) {
|
|
3612
3559
|
return _SectionMetadata.apply(this, arguments);
|
|
3613
3560
|
}
|
|
@@ -3615,7 +3562,7 @@ var require_utils = __commonJS({
|
|
|
3615
3562
|
return _SectionMetadata.toString();
|
|
3616
3563
|
};
|
|
3617
3564
|
return SectionMetadata;
|
|
3618
|
-
}(function(_ref) {
|
|
3565
|
+
})(function(_ref) {
|
|
3619
3566
|
var node = _ref.node;
|
|
3620
3567
|
if (node.section === name) {
|
|
3621
3568
|
section = node;
|
|
@@ -3627,7 +3574,7 @@ var require_utils = __commonJS({
|
|
|
3627
3574
|
function getSectionMetadatas(ast, name) {
|
|
3628
3575
|
var sections = [];
|
|
3629
3576
|
(0, _traverse.traverse)(ast, {
|
|
3630
|
-
SectionMetadata: function(_SectionMetadata2) {
|
|
3577
|
+
SectionMetadata: (function(_SectionMetadata2) {
|
|
3631
3578
|
function SectionMetadata(_x2) {
|
|
3632
3579
|
return _SectionMetadata2.apply(this, arguments);
|
|
3633
3580
|
}
|
|
@@ -3635,7 +3582,7 @@ var require_utils = __commonJS({
|
|
|
3635
3582
|
return _SectionMetadata2.toString();
|
|
3636
3583
|
};
|
|
3637
3584
|
return SectionMetadata;
|
|
3638
|
-
}(function(_ref2) {
|
|
3585
|
+
})(function(_ref2) {
|
|
3639
3586
|
var node = _ref2.node;
|
|
3640
3587
|
if (node.section === name) {
|
|
3641
3588
|
sections.push(node);
|
|
@@ -3797,10 +3744,8 @@ var require_utils = __commonJS({
|
|
|
3797
3744
|
}
|
|
3798
3745
|
}
|
|
3799
3746
|
});
|
|
3800
|
-
|
|
3801
|
-
// node_modules/.pnpm/@webassemblyjs+ast@1.12.1/node_modules/@webassemblyjs/ast/lib/clone.js
|
|
3802
3747
|
var require_clone = __commonJS({
|
|
3803
|
-
"node_modules/.pnpm/@webassemblyjs+ast@1.
|
|
3748
|
+
"node_modules/.pnpm/@webassemblyjs+ast@1.14.1/node_modules/@webassemblyjs/ast/lib/clone.js"(exports) {
|
|
3804
3749
|
Object.defineProperty(exports, "__esModule", {
|
|
3805
3750
|
value: true
|
|
3806
3751
|
});
|
|
@@ -3810,10 +3755,8 @@ var require_clone = __commonJS({
|
|
|
3810
3755
|
}
|
|
3811
3756
|
}
|
|
3812
3757
|
});
|
|
3813
|
-
|
|
3814
|
-
// node_modules/.pnpm/@webassemblyjs+ast@1.12.1/node_modules/@webassemblyjs/ast/lib/transform/ast-module-to-module-context/index.js
|
|
3815
3758
|
var require_ast_module_to_module_context = __commonJS({
|
|
3816
|
-
"node_modules/.pnpm/@webassemblyjs+ast@1.
|
|
3759
|
+
"node_modules/.pnpm/@webassemblyjs+ast@1.14.1/node_modules/@webassemblyjs/ast/lib/transform/ast-module-to-module-context/index.js"(exports) {
|
|
3817
3760
|
Object.defineProperty(exports, "__esModule", {
|
|
3818
3761
|
value: true
|
|
3819
3762
|
});
|
|
@@ -3830,16 +3773,12 @@ var require_ast_module_to_module_context = __commonJS({
|
|
|
3830
3773
|
var descriptor = props[i];
|
|
3831
3774
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
3832
3775
|
descriptor.configurable = true;
|
|
3833
|
-
if ("value" in descriptor)
|
|
3834
|
-
descriptor.writable = true;
|
|
3776
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
3835
3777
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
3836
3778
|
}
|
|
3837
3779
|
}
|
|
3838
3780
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
3839
|
-
if (protoProps)
|
|
3840
|
-
_defineProperties(Constructor.prototype, protoProps);
|
|
3841
|
-
if (staticProps)
|
|
3842
|
-
_defineProperties(Constructor, staticProps);
|
|
3781
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
3843
3782
|
return Constructor;
|
|
3844
3783
|
}
|
|
3845
3784
|
function moduleContextFromModuleAST(m) {
|
|
@@ -3895,7 +3834,7 @@ var require_ast_module_to_module_context = __commonJS({
|
|
|
3895
3834
|
});
|
|
3896
3835
|
return moduleContext;
|
|
3897
3836
|
}
|
|
3898
|
-
var ModuleContext = /* @__PURE__ */ function() {
|
|
3837
|
+
var ModuleContext = /* @__PURE__ */ (function() {
|
|
3899
3838
|
function ModuleContext2() {
|
|
3900
3839
|
_classCallCheck(this, ModuleContext2);
|
|
3901
3840
|
this.funcs = [];
|
|
@@ -4142,14 +4081,12 @@ var require_ast_module_to_module_context = __commonJS({
|
|
|
4142
4081
|
}
|
|
4143
4082
|
}]);
|
|
4144
4083
|
return ModuleContext2;
|
|
4145
|
-
}();
|
|
4084
|
+
})();
|
|
4146
4085
|
exports.ModuleContext = ModuleContext;
|
|
4147
4086
|
}
|
|
4148
4087
|
});
|
|
4149
|
-
|
|
4150
|
-
// node_modules/.pnpm/@webassemblyjs+ast@1.12.1/node_modules/@webassemblyjs/ast/lib/index.js
|
|
4151
4088
|
var require_lib7 = __commonJS({
|
|
4152
|
-
"node_modules/.pnpm/@webassemblyjs+ast@1.
|
|
4089
|
+
"node_modules/.pnpm/@webassemblyjs+ast@1.14.1/node_modules/@webassemblyjs/ast/lib/index.js"(exports) {
|
|
4153
4090
|
Object.defineProperty(exports, "__esModule", {
|
|
4154
4091
|
value: true
|
|
4155
4092
|
});
|
|
@@ -4241,12 +4178,9 @@ var require_lib7 = __commonJS({
|
|
|
4241
4178
|
});
|
|
4242
4179
|
var _nodes = require_nodes();
|
|
4243
4180
|
Object.keys(_nodes).forEach(function(key) {
|
|
4244
|
-
if (key === "default" || key === "__esModule")
|
|
4245
|
-
|
|
4246
|
-
if (
|
|
4247
|
-
return;
|
|
4248
|
-
if (key in exports && exports[key] === _nodes[key])
|
|
4249
|
-
return;
|
|
4181
|
+
if (key === "default" || key === "__esModule") return;
|
|
4182
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
4183
|
+
if (key in exports && exports[key] === _nodes[key]) return;
|
|
4250
4184
|
Object.defineProperty(exports, key, {
|
|
4251
4185
|
enumerable: true,
|
|
4252
4186
|
get: function get() {
|
|
@@ -4259,12 +4193,9 @@ var require_lib7 = __commonJS({
|
|
|
4259
4193
|
var _signatures = require_signatures();
|
|
4260
4194
|
var _utils = require_utils();
|
|
4261
4195
|
Object.keys(_utils).forEach(function(key) {
|
|
4262
|
-
if (key === "default" || key === "__esModule")
|
|
4263
|
-
|
|
4264
|
-
if (
|
|
4265
|
-
return;
|
|
4266
|
-
if (key in exports && exports[key] === _utils[key])
|
|
4267
|
-
return;
|
|
4196
|
+
if (key === "default" || key === "__esModule") return;
|
|
4197
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
4198
|
+
if (key in exports && exports[key] === _utils[key]) return;
|
|
4268
4199
|
Object.defineProperty(exports, key, {
|
|
4269
4200
|
enumerable: true,
|
|
4270
4201
|
get: function get() {
|
|
@@ -4276,10 +4207,8 @@ var require_lib7 = __commonJS({
|
|
|
4276
4207
|
var _astModuleToModuleContext = require_ast_module_to_module_context();
|
|
4277
4208
|
}
|
|
4278
4209
|
});
|
|
4279
|
-
|
|
4280
|
-
// node_modules/.pnpm/@webassemblyjs+leb128@1.12.1/node_modules/@webassemblyjs/leb128/lib/bits.js
|
|
4281
4210
|
var require_bits = __commonJS({
|
|
4282
|
-
"node_modules/.pnpm/@webassemblyjs+leb128@1.
|
|
4211
|
+
"node_modules/.pnpm/@webassemblyjs+leb128@1.14.1/node_modules/@webassemblyjs/leb128/lib/bits.js"(exports) {
|
|
4283
4212
|
Object.defineProperty(exports, "__esModule", {
|
|
4284
4213
|
value: true
|
|
4285
4214
|
});
|
|
@@ -4365,10 +4294,8 @@ var require_bits = __commonJS({
|
|
|
4365
4294
|
}
|
|
4366
4295
|
}
|
|
4367
4296
|
});
|
|
4368
|
-
|
|
4369
|
-
// node_modules/.pnpm/@webassemblyjs+leb128@1.12.1/node_modules/@webassemblyjs/leb128/lib/bufs.js
|
|
4370
4297
|
var require_bufs = __commonJS({
|
|
4371
|
-
"node_modules/.pnpm/@webassemblyjs+leb128@1.
|
|
4298
|
+
"node_modules/.pnpm/@webassemblyjs+leb128@1.14.1/node_modules/@webassemblyjs/leb128/lib/bufs.js"(exports) {
|
|
4372
4299
|
Object.defineProperty(exports, "__esModule", {
|
|
4373
4300
|
value: true
|
|
4374
4301
|
});
|
|
@@ -4503,10 +4430,8 @@ var require_bufs = __commonJS({
|
|
|
4503
4430
|
}
|
|
4504
4431
|
}
|
|
4505
4432
|
});
|
|
4506
|
-
|
|
4507
|
-
// node_modules/.pnpm/@webassemblyjs+leb128@1.12.1/node_modules/@webassemblyjs/leb128/lib/leb.js
|
|
4508
4433
|
var require_leb = __commonJS({
|
|
4509
|
-
"node_modules/.pnpm/@webassemblyjs+leb128@1.
|
|
4434
|
+
"node_modules/.pnpm/@webassemblyjs+leb128@1.14.1/node_modules/@webassemblyjs/leb128/lib/leb.js"(exports) {
|
|
4510
4435
|
function _typeof(obj) {
|
|
4511
4436
|
"@babel/helpers - typeof";
|
|
4512
4437
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
@@ -4528,8 +4453,7 @@ var require_leb = __commonJS({
|
|
|
4528
4453
|
var bits = _interopRequireWildcard(require_bits());
|
|
4529
4454
|
var bufs = _interopRequireWildcard(require_bufs());
|
|
4530
4455
|
function _getRequireWildcardCache(nodeInterop) {
|
|
4531
|
-
if (typeof WeakMap !== "function")
|
|
4532
|
-
return null;
|
|
4456
|
+
if (typeof WeakMap !== "function") return null;
|
|
4533
4457
|
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
|
|
4534
4458
|
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
|
4535
4459
|
return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
|
|
@@ -4537,7 +4461,7 @@ var require_leb = __commonJS({
|
|
|
4537
4461
|
})(nodeInterop);
|
|
4538
4462
|
}
|
|
4539
4463
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
4540
|
-
if (
|
|
4464
|
+
if (obj && obj.__esModule) {
|
|
4541
4465
|
return obj;
|
|
4542
4466
|
}
|
|
4543
4467
|
if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
|
|
@@ -4755,10 +4679,8 @@ var require_leb = __commonJS({
|
|
|
4755
4679
|
exports["default"] = _default;
|
|
4756
4680
|
}
|
|
4757
4681
|
});
|
|
4758
|
-
|
|
4759
|
-
// node_modules/.pnpm/@webassemblyjs+leb128@1.12.1/node_modules/@webassemblyjs/leb128/lib/index.js
|
|
4760
4682
|
var require_lib8 = __commonJS({
|
|
4761
|
-
"node_modules/.pnpm/@webassemblyjs+leb128@1.
|
|
4683
|
+
"node_modules/.pnpm/@webassemblyjs+leb128@1.14.1/node_modules/@webassemblyjs/leb128/lib/index.js"(exports) {
|
|
4762
4684
|
Object.defineProperty(exports, "__esModule", {
|
|
4763
4685
|
value: true
|
|
4764
4686
|
});
|
|
@@ -4801,10 +4723,8 @@ var require_lib8 = __commonJS({
|
|
|
4801
4723
|
}
|
|
4802
4724
|
}
|
|
4803
4725
|
});
|
|
4804
|
-
|
|
4805
|
-
// node_modules/.pnpm/@webassemblyjs+wasm-parser@1.12.1/node_modules/@webassemblyjs/wasm-parser/lib/decoder.js
|
|
4806
4726
|
var require_decoder2 = __commonJS({
|
|
4807
|
-
"node_modules/.pnpm/@webassemblyjs+wasm-parser@1.
|
|
4727
|
+
"node_modules/.pnpm/@webassemblyjs+wasm-parser@1.14.1/node_modules/@webassemblyjs/wasm-parser/lib/decoder.js"(exports) {
|
|
4808
4728
|
function _typeof(obj) {
|
|
4809
4729
|
"@babel/helpers - typeof";
|
|
4810
4730
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
@@ -4832,8 +4752,7 @@ var require_decoder2 = __commonJS({
|
|
|
4832
4752
|
return obj && obj.__esModule ? obj : { "default": obj };
|
|
4833
4753
|
}
|
|
4834
4754
|
function _getRequireWildcardCache(nodeInterop) {
|
|
4835
|
-
if (typeof WeakMap !== "function")
|
|
4836
|
-
return null;
|
|
4755
|
+
if (typeof WeakMap !== "function") return null;
|
|
4837
4756
|
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
|
|
4838
4757
|
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
|
4839
4758
|
return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
|
|
@@ -4841,7 +4760,7 @@ var require_decoder2 = __commonJS({
|
|
|
4841
4760
|
})(nodeInterop);
|
|
4842
4761
|
}
|
|
4843
4762
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
4844
|
-
if (
|
|
4763
|
+
if (obj && obj.__esModule) {
|
|
4845
4764
|
return obj;
|
|
4846
4765
|
}
|
|
4847
4766
|
if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
|
|
@@ -4876,29 +4795,21 @@ var require_decoder2 = __commonJS({
|
|
|
4876
4795
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4877
4796
|
}
|
|
4878
4797
|
function _unsupportedIterableToArray(o, minLen) {
|
|
4879
|
-
if (!o)
|
|
4880
|
-
|
|
4881
|
-
if (typeof o === "string")
|
|
4882
|
-
return _arrayLikeToArray(o, minLen);
|
|
4798
|
+
if (!o) return;
|
|
4799
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
4883
4800
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
4884
|
-
if (n === "Object" && o.constructor)
|
|
4885
|
-
|
|
4886
|
-
if (n === "
|
|
4887
|
-
return Array.from(o);
|
|
4888
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
4889
|
-
return _arrayLikeToArray(o, minLen);
|
|
4801
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
4802
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
4803
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
4890
4804
|
}
|
|
4891
4805
|
function _iterableToArray(iter) {
|
|
4892
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
4893
|
-
return Array.from(iter);
|
|
4806
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
4894
4807
|
}
|
|
4895
4808
|
function _arrayWithoutHoles(arr) {
|
|
4896
|
-
if (Array.isArray(arr))
|
|
4897
|
-
return _arrayLikeToArray(arr);
|
|
4809
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
4898
4810
|
}
|
|
4899
4811
|
function _arrayLikeToArray(arr, len) {
|
|
4900
|
-
if (len == null || len > arr.length)
|
|
4901
|
-
len = arr.length;
|
|
4812
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
4902
4813
|
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
4903
4814
|
arr2[i] = arr[i];
|
|
4904
4815
|
}
|
|
@@ -4929,8 +4840,7 @@ var require_decoder2 = __commonJS({
|
|
|
4929
4840
|
};
|
|
4930
4841
|
}
|
|
4931
4842
|
function dump(b, msg) {
|
|
4932
|
-
if (opts.dump === false)
|
|
4933
|
-
return;
|
|
4843
|
+
if (opts.dump === false) return;
|
|
4934
4844
|
var pad = " ";
|
|
4935
4845
|
var str = "";
|
|
4936
4846
|
if (b.length < 5) {
|
|
@@ -4941,12 +4851,10 @@ var require_decoder2 = __commonJS({
|
|
|
4941
4851
|
console.log(toHex(offset) + ": ", str, pad, ";", msg);
|
|
4942
4852
|
}
|
|
4943
4853
|
function dumpSep(msg) {
|
|
4944
|
-
if (opts.dump === false)
|
|
4945
|
-
return;
|
|
4854
|
+
if (opts.dump === false) return;
|
|
4946
4855
|
console.log(";", msg);
|
|
4947
4856
|
}
|
|
4948
4857
|
var state = {
|
|
4949
|
-
elementsInFuncSection: [],
|
|
4950
4858
|
elementsInExportSection: [],
|
|
4951
4859
|
elementsInCodeSection: [],
|
|
4952
4860
|
/**
|
|
@@ -5146,7 +5054,11 @@ var require_decoder2 = __commonJS({
|
|
|
5146
5054
|
if (type == _helperWasmBytecode["default"].types.func) {
|
|
5147
5055
|
dump([type], "func");
|
|
5148
5056
|
var paramValtypes = parseVec(function(b) {
|
|
5149
|
-
|
|
5057
|
+
var valtype = _helperWasmBytecode["default"].valtypes[b];
|
|
5058
|
+
if (valtype === void 0) {
|
|
5059
|
+
throw new Error("unexpected value type ".concat(b));
|
|
5060
|
+
}
|
|
5061
|
+
return valtype;
|
|
5150
5062
|
});
|
|
5151
5063
|
var params = paramValtypes.map(function(v) {
|
|
5152
5064
|
return t.funcParam(
|
|
@@ -5157,10 +5069,10 @@ var require_decoder2 = __commonJS({
|
|
|
5157
5069
|
var result = parseVec(function(b) {
|
|
5158
5070
|
return _helperWasmBytecode["default"].valtypes[b];
|
|
5159
5071
|
});
|
|
5160
|
-
typeInstructionNodes.push(function() {
|
|
5072
|
+
typeInstructionNodes.push((function() {
|
|
5161
5073
|
var endLoc = getPosition();
|
|
5162
5074
|
return t.withLoc(t.typeInstruction(void 0, t.signature(params, result)), endLoc, _startLoc);
|
|
5163
|
-
}());
|
|
5075
|
+
})());
|
|
5164
5076
|
state.typesInModule.push({
|
|
5165
5077
|
params,
|
|
5166
5078
|
result
|
|
@@ -5219,10 +5131,10 @@ var require_decoder2 = __commonJS({
|
|
|
5219
5131
|
} else {
|
|
5220
5132
|
throw new _helperApiError.CompileError("Unsupported import of type: " + descrType);
|
|
5221
5133
|
}
|
|
5222
|
-
imports.push(function() {
|
|
5134
|
+
imports.push((function() {
|
|
5223
5135
|
var endLoc = getPosition();
|
|
5224
5136
|
return t.withLoc(t.moduleImport(moduleName.value, name.value, importDescr), endLoc, _startLoc2);
|
|
5225
|
-
}());
|
|
5137
|
+
})());
|
|
5226
5138
|
}
|
|
5227
5139
|
return imports;
|
|
5228
5140
|
}
|
|
@@ -5331,10 +5243,10 @@ var require_decoder2 = __commonJS({
|
|
|
5331
5243
|
for (var _i2 = 0; _i2 < localCount; _i2++) {
|
|
5332
5244
|
args.push(t.valtypeLiteral(type));
|
|
5333
5245
|
}
|
|
5334
|
-
var localNode = function() {
|
|
5246
|
+
var localNode = (function() {
|
|
5335
5247
|
var endLoc2 = getPosition();
|
|
5336
5248
|
return t.withLoc(t.instruction("local", args), endLoc2, _startLoc5);
|
|
5337
|
-
}();
|
|
5249
|
+
})();
|
|
5338
5250
|
locals.push(localNode);
|
|
5339
5251
|
dump([valtypeByte], type);
|
|
5340
5252
|
if (typeof type === "undefined") {
|
|
@@ -5363,20 +5275,27 @@ var require_decoder2 = __commonJS({
|
|
|
5363
5275
|
instructionByte = 65024 + readByte();
|
|
5364
5276
|
eatBytes(1);
|
|
5365
5277
|
}
|
|
5278
|
+
if (instructionByte === 252) {
|
|
5279
|
+
instructionByte = 64512 + readByte();
|
|
5280
|
+
eatBytes(1);
|
|
5281
|
+
}
|
|
5366
5282
|
var instruction = _helperWasmBytecode["default"].symbolsByByte[instructionByte];
|
|
5367
5283
|
if (typeof instruction === "undefined") {
|
|
5368
5284
|
throw new _helperApiError.CompileError("Unexpected instruction: " + toHex(instructionByte));
|
|
5369
5285
|
}
|
|
5286
|
+
if (instruction === "illegal") {
|
|
5287
|
+
throw new Error("tried to decode an illegal bytecode: ".concat(toHex(instructionByte)));
|
|
5288
|
+
}
|
|
5370
5289
|
if (typeof instruction.object === "string") {
|
|
5371
5290
|
dump([instructionByte], "".concat(instruction.object, ".").concat(instruction.name));
|
|
5372
5291
|
} else {
|
|
5373
5292
|
dump([instructionByte], instruction.name);
|
|
5374
5293
|
}
|
|
5375
5294
|
if (instruction.name === "end") {
|
|
5376
|
-
var node = function() {
|
|
5295
|
+
var node = (function() {
|
|
5377
5296
|
var endLoc = getPosition();
|
|
5378
5297
|
return t.withLoc(t.instruction(instruction.name), endLoc, _startLoc6);
|
|
5379
|
-
}();
|
|
5298
|
+
})();
|
|
5380
5299
|
code.push(node);
|
|
5381
5300
|
break;
|
|
5382
5301
|
}
|
|
@@ -5384,31 +5303,19 @@ var require_decoder2 = __commonJS({
|
|
|
5384
5303
|
var namedArgs = void 0;
|
|
5385
5304
|
if (instruction.name === "loop") {
|
|
5386
5305
|
var _startLoc7 = getPosition();
|
|
5387
|
-
var
|
|
5388
|
-
eatBytes(1);
|
|
5389
|
-
var blocktype = _helperWasmBytecode["default"].blockTypes[blocktypeByte];
|
|
5390
|
-
dump([blocktypeByte], "blocktype");
|
|
5391
|
-
if (typeof blocktype === "undefined") {
|
|
5392
|
-
throw new _helperApiError.CompileError("Unexpected blocktype: " + toHex(blocktypeByte));
|
|
5393
|
-
}
|
|
5306
|
+
var blocktype = parseBlockType();
|
|
5394
5307
|
var instr = [];
|
|
5395
5308
|
parseInstructionBlock(instr);
|
|
5396
5309
|
var label = t.withRaw(t.identifier(getUniqueName("loop")), "");
|
|
5397
|
-
var loopNode = function() {
|
|
5310
|
+
var loopNode = (function() {
|
|
5398
5311
|
var endLoc = getPosition();
|
|
5399
5312
|
return t.withLoc(t.loopInstruction(label, blocktype, instr), endLoc, _startLoc7);
|
|
5400
|
-
}();
|
|
5313
|
+
})();
|
|
5401
5314
|
code.push(loopNode);
|
|
5402
5315
|
instructionAlreadyCreated = true;
|
|
5403
5316
|
} else if (instruction.name === "if") {
|
|
5404
5317
|
var _startLoc8 = getPosition();
|
|
5405
|
-
var
|
|
5406
|
-
eatBytes(1);
|
|
5407
|
-
var _blocktype = _helperWasmBytecode["default"].blockTypes[_blocktypeByte];
|
|
5408
|
-
dump([_blocktypeByte], "blocktype");
|
|
5409
|
-
if (typeof _blocktype === "undefined") {
|
|
5410
|
-
throw new _helperApiError.CompileError("Unexpected blocktype: " + toHex(_blocktypeByte));
|
|
5411
|
-
}
|
|
5318
|
+
var _blocktype = parseBlockType();
|
|
5412
5319
|
var testIndex = t.withRaw(t.identifier(getUniqueName("if")), "");
|
|
5413
5320
|
var ifBody = [];
|
|
5414
5321
|
parseInstructionBlock(ifBody);
|
|
@@ -5422,28 +5329,22 @@ var require_decoder2 = __commonJS({
|
|
|
5422
5329
|
var consequentInstr = ifBody.slice(0, elseIndex);
|
|
5423
5330
|
var alternate = ifBody.slice(elseIndex + 1);
|
|
5424
5331
|
var testInstrs = [];
|
|
5425
|
-
var ifNode = function() {
|
|
5332
|
+
var ifNode = (function() {
|
|
5426
5333
|
var endLoc = getPosition();
|
|
5427
5334
|
return t.withLoc(t.ifInstruction(testIndex, testInstrs, _blocktype, consequentInstr, alternate), endLoc, _startLoc8);
|
|
5428
|
-
}();
|
|
5335
|
+
})();
|
|
5429
5336
|
code.push(ifNode);
|
|
5430
5337
|
instructionAlreadyCreated = true;
|
|
5431
5338
|
} else if (instruction.name === "block") {
|
|
5432
5339
|
var _startLoc9 = getPosition();
|
|
5433
|
-
var
|
|
5434
|
-
eatBytes(1);
|
|
5435
|
-
var _blocktype2 = _helperWasmBytecode["default"].blockTypes[_blocktypeByte2];
|
|
5436
|
-
dump([_blocktypeByte2], "blocktype");
|
|
5437
|
-
if (typeof _blocktype2 === "undefined") {
|
|
5438
|
-
throw new _helperApiError.CompileError("Unexpected blocktype: " + toHex(_blocktypeByte2));
|
|
5439
|
-
}
|
|
5340
|
+
var _blocktype2 = parseBlockType();
|
|
5440
5341
|
var _instr2 = [];
|
|
5441
5342
|
parseInstructionBlock(_instr2);
|
|
5442
5343
|
var _label = t.withRaw(t.identifier(getUniqueName("block")), "");
|
|
5443
|
-
var blockNode = function() {
|
|
5344
|
+
var blockNode = (function() {
|
|
5444
5345
|
var endLoc = getPosition();
|
|
5445
5346
|
return t.withLoc(t.blockInstruction(_label, _instr2, _blocktype2), endLoc, _startLoc9);
|
|
5446
|
-
}();
|
|
5347
|
+
})();
|
|
5447
5348
|
code.push(blockNode);
|
|
5448
5349
|
instructionAlreadyCreated = true;
|
|
5449
5350
|
} else if (instruction.name === "call") {
|
|
@@ -5451,10 +5352,10 @@ var require_decoder2 = __commonJS({
|
|
|
5451
5352
|
var index = indexu32.value;
|
|
5452
5353
|
eatBytes(indexu32.nextIndex);
|
|
5453
5354
|
dump([index], "index");
|
|
5454
|
-
var callNode = function() {
|
|
5355
|
+
var callNode = (function() {
|
|
5455
5356
|
var endLoc = getPosition();
|
|
5456
5357
|
return t.withLoc(t.callInstruction(t.indexLiteral(index)), endLoc, _startLoc6);
|
|
5457
|
-
}();
|
|
5358
|
+
})();
|
|
5458
5359
|
code.push(callNode);
|
|
5459
5360
|
instructionAlreadyCreated = true;
|
|
5460
5361
|
} else if (instruction.name === "call_indirect") {
|
|
@@ -5474,10 +5375,10 @@ var require_decoder2 = __commonJS({
|
|
|
5474
5375
|
if (flag !== 0) {
|
|
5475
5376
|
throw new _helperApiError.CompileError("zero flag expected");
|
|
5476
5377
|
}
|
|
5477
|
-
code.push(function() {
|
|
5378
|
+
code.push((function() {
|
|
5478
5379
|
var endLoc = getPosition();
|
|
5479
5380
|
return t.withLoc(_callNode, endLoc, _startLoc10);
|
|
5480
|
-
}());
|
|
5381
|
+
})());
|
|
5481
5382
|
instructionAlreadyCreated = true;
|
|
5482
5383
|
} else if (instruction.name === "br_table") {
|
|
5483
5384
|
var indicesu32 = readU32();
|
|
@@ -5509,8 +5410,7 @@ var require_decoder2 = __commonJS({
|
|
|
5509
5410
|
var _offset2 = offsetu32.value;
|
|
5510
5411
|
eatBytes(offsetu32.nextIndex);
|
|
5511
5412
|
dump([_offset2], "offset");
|
|
5512
|
-
if (namedArgs === void 0)
|
|
5513
|
-
namedArgs = {};
|
|
5413
|
+
if (namedArgs === void 0) namedArgs = {};
|
|
5514
5414
|
namedArgs.offset = t.numberLiteralFromRaw(_offset2);
|
|
5515
5415
|
}
|
|
5516
5416
|
} else if (instructionByte >= 65 && instructionByte <= 68) {
|
|
@@ -5597,16 +5497,16 @@ var require_decoder2 = __commonJS({
|
|
|
5597
5497
|
}
|
|
5598
5498
|
if (instructionAlreadyCreated === false) {
|
|
5599
5499
|
if (typeof instruction.object === "string") {
|
|
5600
|
-
var _node3 = function() {
|
|
5500
|
+
var _node3 = (function() {
|
|
5601
5501
|
var endLoc = getPosition();
|
|
5602
5502
|
return t.withLoc(t.objectInstruction(instruction.name, instruction.object, args, namedArgs), endLoc, _startLoc6);
|
|
5603
|
-
}();
|
|
5503
|
+
})();
|
|
5604
5504
|
code.push(_node3);
|
|
5605
5505
|
} else {
|
|
5606
|
-
var _node4 = function() {
|
|
5506
|
+
var _node4 = (function() {
|
|
5607
5507
|
var endLoc = getPosition();
|
|
5608
5508
|
return t.withLoc(t.instruction(instruction.name, args, namedArgs), endLoc, _startLoc6);
|
|
5609
|
-
}();
|
|
5509
|
+
})();
|
|
5610
5510
|
code.push(_node4);
|
|
5611
5511
|
}
|
|
5612
5512
|
}
|
|
@@ -5643,7 +5543,7 @@ var require_decoder2 = __commonJS({
|
|
|
5643
5543
|
dump([elementTypeByte], "element type");
|
|
5644
5544
|
var elementType = _helperWasmBytecode["default"].tableTypes[elementTypeByte];
|
|
5645
5545
|
if (typeof elementType === "undefined") {
|
|
5646
|
-
throw new _helperApiError.CompileError("Unknown element type in table: " + toHex(
|
|
5546
|
+
throw new _helperApiError.CompileError("Unknown element type in table: " + toHex(elementTypeByte));
|
|
5647
5547
|
}
|
|
5648
5548
|
var limits = parseLimits();
|
|
5649
5549
|
return t.table(elementType, limits, name);
|
|
@@ -5712,6 +5612,16 @@ var require_decoder2 = __commonJS({
|
|
|
5712
5612
|
var subSectionSizeInBytesu32 = readVaruint32();
|
|
5713
5613
|
eatBytes(subSectionSizeInBytesu32.nextIndex);
|
|
5714
5614
|
switch (sectionTypeByte.value) {
|
|
5615
|
+
// case 0: {
|
|
5616
|
+
// TODO(sven): re-enable that
|
|
5617
|
+
// Current status: it seems that when we decode the module's name
|
|
5618
|
+
// no name_payload_len is used.
|
|
5619
|
+
//
|
|
5620
|
+
// See https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md#name-section
|
|
5621
|
+
//
|
|
5622
|
+
// nameMetadata.push(...parseNameModule());
|
|
5623
|
+
// break;
|
|
5624
|
+
// }
|
|
5715
5625
|
case 1: {
|
|
5716
5626
|
nameMetadata.push.apply(nameMetadata, _toConsumableArray(parseNameSectionFunctions()));
|
|
5717
5627
|
break;
|
|
@@ -5761,10 +5671,10 @@ var require_decoder2 = __commonJS({
|
|
|
5761
5671
|
var globalType = parseGlobalType();
|
|
5762
5672
|
var init = [];
|
|
5763
5673
|
parseInstructionBlock(init);
|
|
5764
|
-
var node = function() {
|
|
5674
|
+
var node = (function() {
|
|
5765
5675
|
var endLoc = getPosition();
|
|
5766
5676
|
return t.withLoc(t.global(globalType, init), endLoc, _startLoc11);
|
|
5767
|
-
}();
|
|
5677
|
+
})();
|
|
5768
5678
|
globals.push(node);
|
|
5769
5679
|
state.globalsInModule.push(node);
|
|
5770
5680
|
}
|
|
@@ -5776,28 +5686,130 @@ var require_decoder2 = __commonJS({
|
|
|
5776
5686
|
for (var i = 0; i < numberOfElements; i++) {
|
|
5777
5687
|
var _startLoc12 = getPosition();
|
|
5778
5688
|
var tableindexu32 = readU32();
|
|
5779
|
-
var
|
|
5689
|
+
var bitfield = tableindexu32.value;
|
|
5780
5690
|
eatBytes(tableindexu32.nextIndex);
|
|
5781
|
-
dump([
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
var
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5691
|
+
dump([bitfield], "bitfield");
|
|
5692
|
+
if (bitfield === 0) {
|
|
5693
|
+
var instr = [];
|
|
5694
|
+
parseInstructionBlock(instr);
|
|
5695
|
+
var indicesu32 = readU32();
|
|
5696
|
+
var indices = indicesu32.value;
|
|
5697
|
+
eatBytes(indicesu32.nextIndex);
|
|
5698
|
+
dump([indices], "num indices");
|
|
5699
|
+
var indexValues = [];
|
|
5700
|
+
for (var _i5 = 0; _i5 < indices; _i5++) {
|
|
5701
|
+
var indexu32 = readU32();
|
|
5702
|
+
var index = indexu32.value;
|
|
5703
|
+
eatBytes(indexu32.nextIndex);
|
|
5704
|
+
dump([index], "index");
|
|
5705
|
+
indexValues.push(t.indexLiteral(index));
|
|
5706
|
+
}
|
|
5707
|
+
var elemNode = (function() {
|
|
5708
|
+
var endLoc = getPosition();
|
|
5709
|
+
return t.withLoc(t.elem(t.indexLiteral(bitfield), instr, indexValues), endLoc, _startLoc12);
|
|
5710
|
+
})();
|
|
5711
|
+
elems.push(elemNode);
|
|
5712
|
+
} else if (bitfield === 1) {
|
|
5713
|
+
var elemKind = readByte();
|
|
5714
|
+
eatBytes(1);
|
|
5715
|
+
if (elemKind !== 0) {
|
|
5716
|
+
throw new Error("unexpected Elem kind: ".concat(toHex(elemKind)));
|
|
5717
|
+
}
|
|
5718
|
+
var _indicesu = readU32();
|
|
5719
|
+
var _indices = _indicesu.value;
|
|
5720
|
+
eatBytes(_indicesu.nextIndex);
|
|
5721
|
+
dump([_indices], "num indices");
|
|
5722
|
+
var _indexValues = [];
|
|
5723
|
+
for (var _i6 = 0; _i6 < _indices; _i6++) {
|
|
5724
|
+
var _indexu2 = readU32();
|
|
5725
|
+
var _index3 = _indexu2.value;
|
|
5726
|
+
eatBytes(_indexu2.nextIndex);
|
|
5727
|
+
dump([_index3], "index");
|
|
5728
|
+
_indexValues.push(t.indexLiteral(_index3));
|
|
5729
|
+
}
|
|
5730
|
+
} else if (bitfield === 2) {
|
|
5731
|
+
var u32 = readU32();
|
|
5732
|
+
var tableidx = u32.value;
|
|
5733
|
+
eatBytes(u32.nextIndex);
|
|
5734
|
+
dump([tableidx], "tableidx");
|
|
5735
|
+
var _instr3 = [];
|
|
5736
|
+
parseInstructionBlock(_instr3);
|
|
5737
|
+
var _elemKind = readByte();
|
|
5738
|
+
eatBytes(1);
|
|
5739
|
+
if (_elemKind !== 0) {
|
|
5740
|
+
throw new Error("unexpected Elem kind: ".concat(toHex(_elemKind)));
|
|
5741
|
+
}
|
|
5742
|
+
var _indicesu2 = readU32();
|
|
5743
|
+
var _indices2 = _indicesu2.value;
|
|
5744
|
+
eatBytes(_indicesu2.nextIndex);
|
|
5745
|
+
dump([_indices2], "num indices");
|
|
5746
|
+
var _indexValues2 = [];
|
|
5747
|
+
for (var _i7 = 0; _i7 < _indices2; _i7++) {
|
|
5748
|
+
var _indexu3 = readU32();
|
|
5749
|
+
var _index4 = _indexu3.value;
|
|
5750
|
+
eatBytes(_indexu3.nextIndex);
|
|
5751
|
+
dump([_index4], "index");
|
|
5752
|
+
_indexValues2.push(t.indexLiteral(_index4));
|
|
5753
|
+
}
|
|
5754
|
+
var _elemNode = (function() {
|
|
5755
|
+
var endLoc = getPosition();
|
|
5756
|
+
return t.withLoc(t.elem(t.indexLiteral(bitfield), _instr3, _indexValues2), endLoc, _startLoc12);
|
|
5757
|
+
})();
|
|
5758
|
+
elems.push(_elemNode);
|
|
5759
|
+
} else if (bitfield === 3) {
|
|
5760
|
+
var _elemKind2 = readByte();
|
|
5761
|
+
eatBytes(1);
|
|
5762
|
+
if (_elemKind2 !== 0) {
|
|
5763
|
+
throw new Error("unexpected Elem kind: ".concat(toHex(_elemKind2)));
|
|
5764
|
+
}
|
|
5765
|
+
var countU32 = readU32();
|
|
5766
|
+
var count = countU32.value;
|
|
5767
|
+
eatBytes(countU32.nextIndex);
|
|
5768
|
+
dump([count], "count");
|
|
5769
|
+
for (var _i8 = 0; _i8 < count; _i8++) {
|
|
5770
|
+
var _indexu4 = readU32();
|
|
5771
|
+
var _index5 = _indexu4.value;
|
|
5772
|
+
eatBytes(_indexu4.nextIndex);
|
|
5773
|
+
dump([_index5], "index");
|
|
5774
|
+
}
|
|
5775
|
+
} else if (bitfield === 4) {
|
|
5776
|
+
var expr = [];
|
|
5777
|
+
parseInstructionBlock(expr);
|
|
5778
|
+
var _countU = readU32();
|
|
5779
|
+
var _count = _countU.value;
|
|
5780
|
+
eatBytes(_countU.nextIndex);
|
|
5781
|
+
dump([_count], "count");
|
|
5782
|
+
for (var _i9 = 0; _i9 < _count; _i9++) {
|
|
5783
|
+
var code = [];
|
|
5784
|
+
parseInstructionBlock(code);
|
|
5785
|
+
}
|
|
5786
|
+
} else if (bitfield === 5) {
|
|
5787
|
+
var reftype = readByte();
|
|
5788
|
+
eatBytes(1);
|
|
5789
|
+
dump([reftype], "reftype");
|
|
5790
|
+
var _countU2 = readU32();
|
|
5791
|
+
var _count2 = _countU2.value;
|
|
5792
|
+
eatBytes(_countU2.nextIndex);
|
|
5793
|
+
dump([_count2], "count");
|
|
5794
|
+
for (var _i10 = 0; _i10 < _count2; _i10++) {
|
|
5795
|
+
var _code = [];
|
|
5796
|
+
parseInstructionBlock(_code);
|
|
5797
|
+
}
|
|
5798
|
+
} else if (bitfield === 7) {
|
|
5799
|
+
var _reftype = readByte();
|
|
5800
|
+
eatBytes(1);
|
|
5801
|
+
dump([_reftype], "reftype");
|
|
5802
|
+
var _countU3 = readU32();
|
|
5803
|
+
var _count3 = _countU3.value;
|
|
5804
|
+
eatBytes(_countU3.nextIndex);
|
|
5805
|
+
dump([_count3], "count");
|
|
5806
|
+
for (var _i11 = 0; _i11 < _count3; _i11++) {
|
|
5807
|
+
var _code2 = [];
|
|
5808
|
+
parseInstructionBlock(_code2);
|
|
5809
|
+
}
|
|
5810
|
+
} else {
|
|
5811
|
+
throw new Error("unexpected Elem with bitfield ".concat(toHex(bitfield)));
|
|
5795
5812
|
}
|
|
5796
|
-
var elemNode = function() {
|
|
5797
|
-
var endLoc = getPosition();
|
|
5798
|
-
return t.withLoc(t.elem(t.indexLiteral(tableindex), instr, indexValues), endLoc, _startLoc12);
|
|
5799
|
-
}();
|
|
5800
|
-
elems.push(elemNode);
|
|
5801
5813
|
}
|
|
5802
5814
|
return elems;
|
|
5803
5815
|
}
|
|
@@ -5831,10 +5843,10 @@ var require_decoder2 = __commonJS({
|
|
|
5831
5843
|
var startFuncIndex = u32.value;
|
|
5832
5844
|
eatBytes(u32.nextIndex);
|
|
5833
5845
|
dump([startFuncIndex], "index");
|
|
5834
|
-
return function() {
|
|
5846
|
+
return (function() {
|
|
5835
5847
|
var endLoc = getPosition();
|
|
5836
5848
|
return t.withLoc(t.start(t.indexLiteral(startFuncIndex)), endLoc, startLoc);
|
|
5837
|
-
}();
|
|
5849
|
+
})();
|
|
5838
5850
|
}
|
|
5839
5851
|
function parseDataSection(numberOfElements) {
|
|
5840
5852
|
var dataEntries = [];
|
|
@@ -5866,8 +5878,7 @@ var require_decoder2 = __commonJS({
|
|
|
5866
5878
|
if (sectionId >= sectionIndex2 || sectionIndex2 === _helperWasmBytecode["default"].sections.custom) {
|
|
5867
5879
|
sectionIndex2 = sectionId + 1;
|
|
5868
5880
|
} else {
|
|
5869
|
-
if (sectionId !== _helperWasmBytecode["default"].sections.custom)
|
|
5870
|
-
throw new _helperApiError.CompileError("Unexpected section: " + toHex(sectionId));
|
|
5881
|
+
if (sectionId !== _helperWasmBytecode["default"].sections.custom) throw new _helperApiError.CompileError("Unexpected section: " + toHex(sectionId));
|
|
5871
5882
|
}
|
|
5872
5883
|
var nextSectionIndex2 = sectionIndex2;
|
|
5873
5884
|
var startOffset = offset;
|
|
@@ -5875,10 +5886,10 @@ var require_decoder2 = __commonJS({
|
|
|
5875
5886
|
var u32 = readU32();
|
|
5876
5887
|
var sectionSizeInBytes = u32.value;
|
|
5877
5888
|
eatBytes(u32.nextIndex);
|
|
5878
|
-
var sectionSizeInBytesNode = function() {
|
|
5889
|
+
var sectionSizeInBytesNode = (function() {
|
|
5879
5890
|
var endLoc = getPosition();
|
|
5880
5891
|
return t.withLoc(t.numberLiteralFromRaw(sectionSizeInBytes), endLoc, startLoc);
|
|
5881
|
-
}();
|
|
5892
|
+
})();
|
|
5882
5893
|
switch (sectionId) {
|
|
5883
5894
|
case _helperWasmBytecode["default"].sections.type: {
|
|
5884
5895
|
dumpSep("section Type");
|
|
@@ -5888,10 +5899,10 @@ var require_decoder2 = __commonJS({
|
|
|
5888
5899
|
var _u = readU32();
|
|
5889
5900
|
var numberOfTypes = _u.value;
|
|
5890
5901
|
eatBytes(_u.nextIndex);
|
|
5891
|
-
var metadata2 = t.sectionMetadata("type", startOffset, sectionSizeInBytesNode, function() {
|
|
5902
|
+
var metadata2 = t.sectionMetadata("type", startOffset, sectionSizeInBytesNode, (function() {
|
|
5892
5903
|
var endLoc = getPosition();
|
|
5893
5904
|
return t.withLoc(t.numberLiteralFromRaw(numberOfTypes), endLoc, _startLoc13);
|
|
5894
|
-
}());
|
|
5905
|
+
})());
|
|
5895
5906
|
var nodes2 = parseTypeSection(numberOfTypes);
|
|
5896
5907
|
return {
|
|
5897
5908
|
nodes: nodes2,
|
|
@@ -5908,10 +5919,10 @@ var require_decoder2 = __commonJS({
|
|
|
5908
5919
|
var numberOfTable = _u2.value;
|
|
5909
5920
|
eatBytes(_u2.nextIndex);
|
|
5910
5921
|
dump([numberOfTable], "num tables");
|
|
5911
|
-
var _metadata = t.sectionMetadata("table", startOffset, sectionSizeInBytesNode, function() {
|
|
5922
|
+
var _metadata = t.sectionMetadata("table", startOffset, sectionSizeInBytesNode, (function() {
|
|
5912
5923
|
var endLoc = getPosition();
|
|
5913
5924
|
return t.withLoc(t.numberLiteralFromRaw(numberOfTable), endLoc, _startLoc14);
|
|
5914
|
-
}());
|
|
5925
|
+
})());
|
|
5915
5926
|
var _nodes = parseTableSection(numberOfTable);
|
|
5916
5927
|
return {
|
|
5917
5928
|
nodes: _nodes,
|
|
@@ -5928,10 +5939,10 @@ var require_decoder2 = __commonJS({
|
|
|
5928
5939
|
var numberOfImports = numberOfImportsu32.value;
|
|
5929
5940
|
eatBytes(numberOfImportsu32.nextIndex);
|
|
5930
5941
|
dump([numberOfImports], "number of imports");
|
|
5931
|
-
var _metadata2 = t.sectionMetadata("import", startOffset, sectionSizeInBytesNode, function() {
|
|
5942
|
+
var _metadata2 = t.sectionMetadata("import", startOffset, sectionSizeInBytesNode, (function() {
|
|
5932
5943
|
var endLoc = getPosition();
|
|
5933
5944
|
return t.withLoc(t.numberLiteralFromRaw(numberOfImports), endLoc, _startLoc15);
|
|
5934
|
-
}());
|
|
5945
|
+
})());
|
|
5935
5946
|
var _nodes2 = parseImportSection(numberOfImports);
|
|
5936
5947
|
return {
|
|
5937
5948
|
nodes: _nodes2,
|
|
@@ -5947,10 +5958,10 @@ var require_decoder2 = __commonJS({
|
|
|
5947
5958
|
var numberOfFunctionsu32 = readU32();
|
|
5948
5959
|
var numberOfFunctions = numberOfFunctionsu32.value;
|
|
5949
5960
|
eatBytes(numberOfFunctionsu32.nextIndex);
|
|
5950
|
-
var _metadata3 = t.sectionMetadata("func", startOffset, sectionSizeInBytesNode, function() {
|
|
5961
|
+
var _metadata3 = t.sectionMetadata("func", startOffset, sectionSizeInBytesNode, (function() {
|
|
5951
5962
|
var endLoc = getPosition();
|
|
5952
5963
|
return t.withLoc(t.numberLiteralFromRaw(numberOfFunctions), endLoc, _startLoc16);
|
|
5953
|
-
}());
|
|
5964
|
+
})());
|
|
5954
5965
|
parseFuncSection(numberOfFunctions);
|
|
5955
5966
|
var _nodes3 = [];
|
|
5956
5967
|
return {
|
|
@@ -5967,10 +5978,10 @@ var require_decoder2 = __commonJS({
|
|
|
5967
5978
|
var _u3 = readU32();
|
|
5968
5979
|
var numberOfExport = _u3.value;
|
|
5969
5980
|
eatBytes(_u3.nextIndex);
|
|
5970
|
-
var _metadata4 = t.sectionMetadata("export", startOffset, sectionSizeInBytesNode, function() {
|
|
5981
|
+
var _metadata4 = t.sectionMetadata("export", startOffset, sectionSizeInBytesNode, (function() {
|
|
5971
5982
|
var endLoc = getPosition();
|
|
5972
5983
|
return t.withLoc(t.numberLiteralFromRaw(numberOfExport), endLoc, _startLoc17);
|
|
5973
|
-
}());
|
|
5984
|
+
})());
|
|
5974
5985
|
parseExportSection(numberOfExport);
|
|
5975
5986
|
var _nodes4 = [];
|
|
5976
5987
|
return {
|
|
@@ -5987,10 +5998,10 @@ var require_decoder2 = __commonJS({
|
|
|
5987
5998
|
var _u4 = readU32();
|
|
5988
5999
|
var numberOfFuncs = _u4.value;
|
|
5989
6000
|
eatBytes(_u4.nextIndex);
|
|
5990
|
-
var _metadata5 = t.sectionMetadata("code", startOffset, sectionSizeInBytesNode, function() {
|
|
6001
|
+
var _metadata5 = t.sectionMetadata("code", startOffset, sectionSizeInBytesNode, (function() {
|
|
5991
6002
|
var endLoc = getPosition();
|
|
5992
6003
|
return t.withLoc(t.numberLiteralFromRaw(numberOfFuncs), endLoc, _startLoc18);
|
|
5993
|
-
}());
|
|
6004
|
+
})());
|
|
5994
6005
|
if (opts.ignoreCodeSection === true) {
|
|
5995
6006
|
var remainingBytes = sectionSizeInBytes - _u4.nextIndex;
|
|
5996
6007
|
eatBytes(remainingBytes);
|
|
@@ -6024,10 +6035,10 @@ var require_decoder2 = __commonJS({
|
|
|
6024
6035
|
var numberOfElementsu32 = readU32();
|
|
6025
6036
|
var numberOfElements = numberOfElementsu32.value;
|
|
6026
6037
|
eatBytes(numberOfElementsu32.nextIndex);
|
|
6027
|
-
var _metadata7 = t.sectionMetadata("element", startOffset, sectionSizeInBytesNode, function() {
|
|
6038
|
+
var _metadata7 = t.sectionMetadata("element", startOffset, sectionSizeInBytesNode, (function() {
|
|
6028
6039
|
var endLoc = getPosition();
|
|
6029
6040
|
return t.withLoc(t.numberLiteralFromRaw(numberOfElements), endLoc, _startLoc19);
|
|
6030
|
-
}());
|
|
6041
|
+
})());
|
|
6031
6042
|
var _nodes7 = parseElemSection(numberOfElements);
|
|
6032
6043
|
return {
|
|
6033
6044
|
nodes: _nodes7,
|
|
@@ -6043,10 +6054,10 @@ var require_decoder2 = __commonJS({
|
|
|
6043
6054
|
var numberOfGlobalsu32 = readU32();
|
|
6044
6055
|
var numberOfGlobals = numberOfGlobalsu32.value;
|
|
6045
6056
|
eatBytes(numberOfGlobalsu32.nextIndex);
|
|
6046
|
-
var _metadata8 = t.sectionMetadata("global", startOffset, sectionSizeInBytesNode, function() {
|
|
6057
|
+
var _metadata8 = t.sectionMetadata("global", startOffset, sectionSizeInBytesNode, (function() {
|
|
6047
6058
|
var endLoc = getPosition();
|
|
6048
6059
|
return t.withLoc(t.numberLiteralFromRaw(numberOfGlobals), endLoc, _startLoc20);
|
|
6049
|
-
}());
|
|
6060
|
+
})());
|
|
6050
6061
|
var _nodes8 = parseGlobalSection(numberOfGlobals);
|
|
6051
6062
|
return {
|
|
6052
6063
|
nodes: _nodes8,
|
|
@@ -6062,10 +6073,10 @@ var require_decoder2 = __commonJS({
|
|
|
6062
6073
|
var _numberOfElementsu = readU32();
|
|
6063
6074
|
var _numberOfElements = _numberOfElementsu.value;
|
|
6064
6075
|
eatBytes(_numberOfElementsu.nextIndex);
|
|
6065
|
-
var _metadata9 = t.sectionMetadata("memory", startOffset, sectionSizeInBytesNode, function() {
|
|
6076
|
+
var _metadata9 = t.sectionMetadata("memory", startOffset, sectionSizeInBytesNode, (function() {
|
|
6066
6077
|
var endLoc = getPosition();
|
|
6067
6078
|
return t.withLoc(t.numberLiteralFromRaw(_numberOfElements), endLoc, _startLoc21);
|
|
6068
|
-
}());
|
|
6079
|
+
})());
|
|
6069
6080
|
var _nodes9 = parseMemorySection(_numberOfElements);
|
|
6070
6081
|
return {
|
|
6071
6082
|
nodes: _nodes9,
|
|
@@ -6082,10 +6093,10 @@ var require_decoder2 = __commonJS({
|
|
|
6082
6093
|
var _numberOfElementsu2 = readU32();
|
|
6083
6094
|
var _numberOfElements2 = _numberOfElementsu2.value;
|
|
6084
6095
|
eatBytes(_numberOfElementsu2.nextIndex);
|
|
6085
|
-
_metadata10.vectorOfSize = function() {
|
|
6096
|
+
_metadata10.vectorOfSize = (function() {
|
|
6086
6097
|
var endLoc = getPosition();
|
|
6087
6098
|
return t.withLoc(t.numberLiteralFromRaw(_numberOfElements2), endLoc, _startLoc22);
|
|
6088
|
-
}();
|
|
6099
|
+
})();
|
|
6089
6100
|
if (opts.ignoreDataSection === true) {
|
|
6090
6101
|
var _remainingBytes = sectionSizeInBytes - _numberOfElementsu2.nextIndex;
|
|
6091
6102
|
eatBytes(_remainingBytes);
|
|
@@ -6155,6 +6166,24 @@ var require_decoder2 = __commonJS({
|
|
|
6155
6166
|
};
|
|
6156
6167
|
}
|
|
6157
6168
|
}
|
|
6169
|
+
function parseBlockType() {
|
|
6170
|
+
var blocktypeByte = readByte();
|
|
6171
|
+
var blocktype = _helperWasmBytecode["default"].blockTypes[blocktypeByte];
|
|
6172
|
+
if (typeof blocktype !== "undefined") {
|
|
6173
|
+
eatBytes(1);
|
|
6174
|
+
dump([blocktypeByte], "blocktype");
|
|
6175
|
+
return blocktype;
|
|
6176
|
+
} else {
|
|
6177
|
+
var u32 = readU32();
|
|
6178
|
+
eatBytes(u32.nextIndex);
|
|
6179
|
+
var signature = state.typesInModule[u32.value];
|
|
6180
|
+
console.log({
|
|
6181
|
+
signature
|
|
6182
|
+
});
|
|
6183
|
+
dump([u32.value], "typeidx");
|
|
6184
|
+
return u32.value;
|
|
6185
|
+
}
|
|
6186
|
+
}
|
|
6158
6187
|
parseModuleHeader();
|
|
6159
6188
|
parseVersion();
|
|
6160
6189
|
var moduleFields = [];
|
|
@@ -6224,10 +6253,8 @@ var require_decoder2 = __commonJS({
|
|
|
6224
6253
|
}
|
|
6225
6254
|
}
|
|
6226
6255
|
});
|
|
6227
|
-
|
|
6228
|
-
// node_modules/.pnpm/@webassemblyjs+wasm-parser@1.12.1/node_modules/@webassemblyjs/wasm-parser/lib/index.js
|
|
6229
6256
|
var require_lib9 = __commonJS({
|
|
6230
|
-
"node_modules/.pnpm/@webassemblyjs+wasm-parser@1.
|
|
6257
|
+
"node_modules/.pnpm/@webassemblyjs+wasm-parser@1.14.1/node_modules/@webassemblyjs/wasm-parser/lib/index.js"(exports) {
|
|
6231
6258
|
function _typeof(obj) {
|
|
6232
6259
|
"@babel/helpers - typeof";
|
|
6233
6260
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
@@ -6248,8 +6275,7 @@ var require_lib9 = __commonJS({
|
|
|
6248
6275
|
var decoder = _interopRequireWildcard(require_decoder2());
|
|
6249
6276
|
var t = _interopRequireWildcard(require_lib7());
|
|
6250
6277
|
function _getRequireWildcardCache(nodeInterop) {
|
|
6251
|
-
if (typeof WeakMap !== "function")
|
|
6252
|
-
return null;
|
|
6278
|
+
if (typeof WeakMap !== "function") return null;
|
|
6253
6279
|
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
|
|
6254
6280
|
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
|
6255
6281
|
return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
|
|
@@ -6257,7 +6283,7 @@ var require_lib9 = __commonJS({
|
|
|
6257
6283
|
})(nodeInterop);
|
|
6258
6284
|
}
|
|
6259
6285
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
6260
|
-
if (
|
|
6286
|
+
if (obj && obj.__esModule) {
|
|
6261
6287
|
return obj;
|
|
6262
6288
|
}
|
|
6263
6289
|
if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
|
|
@@ -6306,7 +6332,7 @@ var require_lib9 = __commonJS({
|
|
|
6306
6332
|
return;
|
|
6307
6333
|
}
|
|
6308
6334
|
t.traverse(ast, {
|
|
6309
|
-
Func: function(_Func) {
|
|
6335
|
+
Func: (function(_Func) {
|
|
6310
6336
|
function Func(_x) {
|
|
6311
6337
|
return _Func.apply(this, arguments);
|
|
6312
6338
|
}
|
|
@@ -6314,7 +6340,7 @@ var require_lib9 = __commonJS({
|
|
|
6314
6340
|
return _Func.toString();
|
|
6315
6341
|
};
|
|
6316
6342
|
return Func;
|
|
6317
|
-
}(function(_ref2) {
|
|
6343
|
+
})(function(_ref2) {
|
|
6318
6344
|
var node = _ref2.node;
|
|
6319
6345
|
var nodeName = node.name;
|
|
6320
6346
|
var indexBasedFunctionName = nodeName.value;
|
|
@@ -6330,7 +6356,7 @@ var require_lib9 = __commonJS({
|
|
|
6330
6356
|
}
|
|
6331
6357
|
}),
|
|
6332
6358
|
// Also update the reference in the export
|
|
6333
|
-
ModuleExport: function(_ModuleExport) {
|
|
6359
|
+
ModuleExport: (function(_ModuleExport) {
|
|
6334
6360
|
function ModuleExport(_x2) {
|
|
6335
6361
|
return _ModuleExport.apply(this, arguments);
|
|
6336
6362
|
}
|
|
@@ -6338,7 +6364,7 @@ var require_lib9 = __commonJS({
|
|
|
6338
6364
|
return _ModuleExport.toString();
|
|
6339
6365
|
};
|
|
6340
6366
|
return ModuleExport;
|
|
6341
|
-
}(function(_ref3) {
|
|
6367
|
+
})(function(_ref3) {
|
|
6342
6368
|
var node = _ref3.node;
|
|
6343
6369
|
if (node.descr.exportType === "Func") {
|
|
6344
6370
|
var nodeName = node.descr.id;
|
|
@@ -6351,7 +6377,7 @@ var require_lib9 = __commonJS({
|
|
|
6351
6377
|
}
|
|
6352
6378
|
}
|
|
6353
6379
|
}),
|
|
6354
|
-
ModuleImport: function(_ModuleImport) {
|
|
6380
|
+
ModuleImport: (function(_ModuleImport) {
|
|
6355
6381
|
function ModuleImport(_x3) {
|
|
6356
6382
|
return _ModuleImport.apply(this, arguments);
|
|
6357
6383
|
}
|
|
@@ -6359,7 +6385,7 @@ var require_lib9 = __commonJS({
|
|
|
6359
6385
|
return _ModuleImport.toString();
|
|
6360
6386
|
};
|
|
6361
6387
|
return ModuleImport;
|
|
6362
|
-
}(function(_ref4) {
|
|
6388
|
+
})(function(_ref4) {
|
|
6363
6389
|
var node = _ref4.node;
|
|
6364
6390
|
if (node.descr.type === "FuncImportDescr") {
|
|
6365
6391
|
var indexBasedFunctionName = node.descr.id;
|
|
@@ -6372,7 +6398,7 @@ var require_lib9 = __commonJS({
|
|
|
6372
6398
|
}
|
|
6373
6399
|
}
|
|
6374
6400
|
}),
|
|
6375
|
-
CallInstruction: function(_CallInstruction) {
|
|
6401
|
+
CallInstruction: (function(_CallInstruction) {
|
|
6376
6402
|
function CallInstruction(_x4) {
|
|
6377
6403
|
return _CallInstruction.apply(this, arguments);
|
|
6378
6404
|
}
|
|
@@ -6380,7 +6406,7 @@ var require_lib9 = __commonJS({
|
|
|
6380
6406
|
return _CallInstruction.toString();
|
|
6381
6407
|
};
|
|
6382
6408
|
return CallInstruction;
|
|
6383
|
-
}(function(nodePath) {
|
|
6409
|
+
})(function(nodePath) {
|
|
6384
6410
|
var node = nodePath.node;
|
|
6385
6411
|
var index = node.index.value;
|
|
6386
6412
|
var functionName = functionNames.find(function(f) {
|
|
@@ -6411,7 +6437,7 @@ var require_lib9 = __commonJS({
|
|
|
6411
6437
|
return;
|
|
6412
6438
|
}
|
|
6413
6439
|
t.traverse(ast, {
|
|
6414
|
-
Func: function(_Func2) {
|
|
6440
|
+
Func: (function(_Func2) {
|
|
6415
6441
|
function Func(_x5) {
|
|
6416
6442
|
return _Func2.apply(this, arguments);
|
|
6417
6443
|
}
|
|
@@ -6419,7 +6445,7 @@ var require_lib9 = __commonJS({
|
|
|
6419
6445
|
return _Func2.toString();
|
|
6420
6446
|
};
|
|
6421
6447
|
return Func;
|
|
6422
|
-
}(function(_ref6) {
|
|
6448
|
+
})(function(_ref6) {
|
|
6423
6449
|
var node = _ref6.node;
|
|
6424
6450
|
var signature = node.signature;
|
|
6425
6451
|
if (signature.type !== "Signature") {
|
|
@@ -6441,7 +6467,7 @@ var require_lib9 = __commonJS({
|
|
|
6441
6467
|
}
|
|
6442
6468
|
function restoreModuleName(ast) {
|
|
6443
6469
|
t.traverse(ast, {
|
|
6444
|
-
ModuleNameMetadata: function(_ModuleNameMetadata) {
|
|
6470
|
+
ModuleNameMetadata: (function(_ModuleNameMetadata) {
|
|
6445
6471
|
function ModuleNameMetadata(_x6) {
|
|
6446
6472
|
return _ModuleNameMetadata.apply(this, arguments);
|
|
6447
6473
|
}
|
|
@@ -6449,9 +6475,9 @@ var require_lib9 = __commonJS({
|
|
|
6449
6475
|
return _ModuleNameMetadata.toString();
|
|
6450
6476
|
};
|
|
6451
6477
|
return ModuleNameMetadata;
|
|
6452
|
-
}(function(moduleNameMetadataPath) {
|
|
6478
|
+
})(function(moduleNameMetadataPath) {
|
|
6453
6479
|
t.traverse(ast, {
|
|
6454
|
-
Module: function(_Module) {
|
|
6480
|
+
Module: (function(_Module) {
|
|
6455
6481
|
function Module(_x7) {
|
|
6456
6482
|
return _Module.apply(this, arguments);
|
|
6457
6483
|
}
|
|
@@ -6459,7 +6485,7 @@ var require_lib9 = __commonJS({
|
|
|
6459
6485
|
return _Module.toString();
|
|
6460
6486
|
};
|
|
6461
6487
|
return Module;
|
|
6462
|
-
}(function(_ref7) {
|
|
6488
|
+
})(function(_ref7) {
|
|
6463
6489
|
var node = _ref7.node;
|
|
6464
6490
|
var name = moduleNameMetadataPath.node.value;
|
|
6465
6491
|
if (name === "") {
|
|
@@ -6483,9 +6509,7 @@ var require_lib9 = __commonJS({
|
|
|
6483
6509
|
}
|
|
6484
6510
|
}
|
|
6485
6511
|
});
|
|
6486
|
-
|
|
6487
|
-
// lib/wasm-parser.in.mjs
|
|
6488
|
-
var import_wasm_parser = __toESM(require_lib9(), 1);
|
|
6512
|
+
var import_wasm_parser = __toESM(require_lib9());
|
|
6489
6513
|
var export_decode = import_wasm_parser.decode;
|
|
6490
6514
|
|
|
6491
6515
|
function parseWasm(source, opts = {}) {
|