unwasm 0.3.9 → 0.3.11
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 +392 -335
- 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 +392 -335
- package/package.json +35 -33
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.12.1/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
|
});
|
|
@@ -317,10 +302,8 @@ var require_lib2 = __commonJS({
|
|
|
317
302
|
}
|
|
318
303
|
}
|
|
319
304
|
});
|
|
320
|
-
|
|
321
|
-
// node_modules/.pnpm/@webassemblyjs+utf8@1.12.1/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.12.1/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.12.1/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.12.1/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_patch_hash=339774429611ed34bc80bc6bbe80b2e7a85c850a1f7612f4e8d36151bf486101/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.12.1/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_patch_hash=339774429611ed34bc80bc6bbe80b2e7a85c850a1f7612f4e8d36151bf486101/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),
|
|
@@ -3373,6 +3321,19 @@ var require_lib6 = __commonJS({
|
|
|
3373
3321
|
194: createSymbolObject("extend8_s", "i64"),
|
|
3374
3322
|
195: createSymbolObject("extend16_s", "i64"),
|
|
3375
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),
|
|
3376
3337
|
// Atomic Memory Instructions
|
|
3377
3338
|
65024: createSymbol("memory.atomic.notify", 1),
|
|
3378
3339
|
65025: createSymbol("memory.atomic.wait32", 1),
|
|
@@ -3439,7 +3400,40 @@ var require_lib6 = __commonJS({
|
|
|
3439
3400
|
65099: createSymbolObject("atomic.rmw16_u.cmpxchg_u", "i32", 1),
|
|
3440
3401
|
65100: createSymbolObject("atomic.rmw8_u.cmpxchg_u", "i64", 1),
|
|
3441
3402
|
65101: createSymbolObject("atomic.rmw16_u.cmpxchg_u", "i64", 1),
|
|
3442
|
-
65102: createSymbolObject("atomic.rmw32_u.cmpxchg_u", "i64", 1)
|
|
3403
|
+
65102: createSymbolObject("atomic.rmw32_u.cmpxchg_u", "i64", 1),
|
|
3404
|
+
// FC (misc prefix) — saturating trunc + bulk-mem
|
|
3405
|
+
64519: createSymbolObject("trunc_sat_f64_u", "i64", 0),
|
|
3406
|
+
// i64.trunc_sat_f64_u
|
|
3407
|
+
64515: createSymbolObject("trunc_sat_f64_u", "i32", 0),
|
|
3408
|
+
// i32.trunc_sat_f64_u
|
|
3409
|
+
64518: createSymbolObject("trunc_sat_f64_s", "i64", 0),
|
|
3410
|
+
// i64.trunc_sat_f64_s
|
|
3411
|
+
// Core + Exception Handling (EH) proposal
|
|
3412
|
+
0: createSymbolObject("unreachable", "void", 0),
|
|
3413
|
+
6: createSymbolObject("try", "block", 1),
|
|
3414
|
+
// blocktype immediate
|
|
3415
|
+
7: createSymbolObject("catch", "tag", 1),
|
|
3416
|
+
// tagidx immediate
|
|
3417
|
+
8: createSymbolObject("throw", "tag", 1),
|
|
3418
|
+
// tagidx immediate
|
|
3419
|
+
10: createSymbolObject("throw_ref", "exnref", 0),
|
|
3420
|
+
// rethrow from stack (no immediate)
|
|
3421
|
+
12: createSymbolObject("br", "label", 1),
|
|
3422
|
+
// labelidx immediate
|
|
3423
|
+
24: createSymbolObject("delegate", "label", 1),
|
|
3424
|
+
// labelidx immediate
|
|
3425
|
+
// The following single-byte opcodes are NOT assigned in core, and not valid
|
|
3426
|
+
// single-byte encodings for SIMD/atomics/gc either (those use FD/FE/FB/FC prefixes):
|
|
3427
|
+
232: illegalop,
|
|
3428
|
+
247: illegalop,
|
|
3429
|
+
246: illegalop,
|
|
3430
|
+
245: illegalop,
|
|
3431
|
+
// Same here — these single-byte values don’t correspond to any standardized core/EH op:
|
|
3432
|
+
198: illegalop,
|
|
3433
|
+
203: illegalop,
|
|
3434
|
+
207: illegalop,
|
|
3435
|
+
219: illegalop,
|
|
3436
|
+
220: illegalop
|
|
3443
3437
|
};
|
|
3444
3438
|
var symbolsByName = invertMap(symbolsByByte, function(obj) {
|
|
3445
3439
|
if (typeof obj.object === "string") {
|
|
@@ -3467,10 +3461,8 @@ var require_lib6 = __commonJS({
|
|
|
3467
3461
|
exports["default"] = _default;
|
|
3468
3462
|
}
|
|
3469
3463
|
});
|
|
3470
|
-
|
|
3471
|
-
// node_modules/.pnpm/@webassemblyjs+ast@1.12.1/node_modules/@webassemblyjs/ast/lib/utils.js
|
|
3472
3464
|
var require_utils = __commonJS({
|
|
3473
|
-
"node_modules/.pnpm/@webassemblyjs+ast@1.
|
|
3465
|
+
"node_modules/.pnpm/@webassemblyjs+ast@1.14.1/node_modules/@webassemblyjs/ast/lib/utils.js"(exports) {
|
|
3474
3466
|
Object.defineProperty(exports, "__esModule", {
|
|
3475
3467
|
value: true
|
|
3476
3468
|
});
|
|
@@ -3494,8 +3486,7 @@ var require_utils = __commonJS({
|
|
|
3494
3486
|
var _traverse = require_traverse();
|
|
3495
3487
|
var _helperWasmBytecode = _interopRequireWildcard(require_lib6());
|
|
3496
3488
|
function _getRequireWildcardCache(nodeInterop) {
|
|
3497
|
-
if (typeof WeakMap !== "function")
|
|
3498
|
-
return null;
|
|
3489
|
+
if (typeof WeakMap !== "function") return null;
|
|
3499
3490
|
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
|
|
3500
3491
|
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
|
3501
3492
|
return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
|
|
@@ -3503,7 +3494,7 @@ var require_utils = __commonJS({
|
|
|
3503
3494
|
})(nodeInterop);
|
|
3504
3495
|
}
|
|
3505
3496
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
3506
|
-
if (
|
|
3497
|
+
if (obj && obj.__esModule) {
|
|
3507
3498
|
return obj;
|
|
3508
3499
|
}
|
|
3509
3500
|
if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
|
|
@@ -3538,21 +3529,15 @@ var require_utils = __commonJS({
|
|
|
3538
3529
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3539
3530
|
}
|
|
3540
3531
|
function _unsupportedIterableToArray(o, minLen) {
|
|
3541
|
-
if (!o)
|
|
3542
|
-
|
|
3543
|
-
if (typeof o === "string")
|
|
3544
|
-
return _arrayLikeToArray(o, minLen);
|
|
3532
|
+
if (!o) return;
|
|
3533
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
3545
3534
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
3546
|
-
if (n === "Object" && o.constructor)
|
|
3547
|
-
|
|
3548
|
-
if (n === "
|
|
3549
|
-
return Array.from(o);
|
|
3550
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
3551
|
-
return _arrayLikeToArray(o, minLen);
|
|
3535
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
3536
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
3537
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
3552
3538
|
}
|
|
3553
3539
|
function _arrayLikeToArray(arr, len) {
|
|
3554
|
-
if (len == null || len > arr.length)
|
|
3555
|
-
len = arr.length;
|
|
3540
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3556
3541
|
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
3557
3542
|
arr2[i] = arr[i];
|
|
3558
3543
|
}
|
|
@@ -3560,8 +3545,7 @@ var require_utils = __commonJS({
|
|
|
3560
3545
|
}
|
|
3561
3546
|
function _iterableToArrayLimit(arr, i) {
|
|
3562
3547
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3563
|
-
if (_i == null)
|
|
3564
|
-
return;
|
|
3548
|
+
if (_i == null) return;
|
|
3565
3549
|
var _arr = [];
|
|
3566
3550
|
var _n = true;
|
|
3567
3551
|
var _d = false;
|
|
@@ -3569,26 +3553,22 @@ var require_utils = __commonJS({
|
|
|
3569
3553
|
try {
|
|
3570
3554
|
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
3571
3555
|
_arr.push(_s.value);
|
|
3572
|
-
if (i && _arr.length === i)
|
|
3573
|
-
break;
|
|
3556
|
+
if (i && _arr.length === i) break;
|
|
3574
3557
|
}
|
|
3575
3558
|
} catch (err) {
|
|
3576
3559
|
_d = true;
|
|
3577
3560
|
_e = err;
|
|
3578
3561
|
} finally {
|
|
3579
3562
|
try {
|
|
3580
|
-
if (!_n && _i["return"] != null)
|
|
3581
|
-
_i["return"]();
|
|
3563
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
3582
3564
|
} finally {
|
|
3583
|
-
if (_d)
|
|
3584
|
-
throw _e;
|
|
3565
|
+
if (_d) throw _e;
|
|
3585
3566
|
}
|
|
3586
3567
|
}
|
|
3587
3568
|
return _arr;
|
|
3588
3569
|
}
|
|
3589
3570
|
function _arrayWithHoles(arr) {
|
|
3590
|
-
if (Array.isArray(arr))
|
|
3591
|
-
return arr;
|
|
3571
|
+
if (Array.isArray(arr)) return arr;
|
|
3592
3572
|
}
|
|
3593
3573
|
function _typeof(obj) {
|
|
3594
3574
|
"@babel/helpers - typeof";
|
|
@@ -3609,7 +3589,7 @@ var require_utils = __commonJS({
|
|
|
3609
3589
|
function getSectionMetadata(ast, name) {
|
|
3610
3590
|
var section;
|
|
3611
3591
|
(0, _traverse.traverse)(ast, {
|
|
3612
|
-
SectionMetadata: function(_SectionMetadata) {
|
|
3592
|
+
SectionMetadata: (function(_SectionMetadata) {
|
|
3613
3593
|
function SectionMetadata(_x) {
|
|
3614
3594
|
return _SectionMetadata.apply(this, arguments);
|
|
3615
3595
|
}
|
|
@@ -3617,7 +3597,7 @@ var require_utils = __commonJS({
|
|
|
3617
3597
|
return _SectionMetadata.toString();
|
|
3618
3598
|
};
|
|
3619
3599
|
return SectionMetadata;
|
|
3620
|
-
}(function(_ref) {
|
|
3600
|
+
})(function(_ref) {
|
|
3621
3601
|
var node = _ref.node;
|
|
3622
3602
|
if (node.section === name) {
|
|
3623
3603
|
section = node;
|
|
@@ -3629,7 +3609,7 @@ var require_utils = __commonJS({
|
|
|
3629
3609
|
function getSectionMetadatas(ast, name) {
|
|
3630
3610
|
var sections = [];
|
|
3631
3611
|
(0, _traverse.traverse)(ast, {
|
|
3632
|
-
SectionMetadata: function(_SectionMetadata2) {
|
|
3612
|
+
SectionMetadata: (function(_SectionMetadata2) {
|
|
3633
3613
|
function SectionMetadata(_x2) {
|
|
3634
3614
|
return _SectionMetadata2.apply(this, arguments);
|
|
3635
3615
|
}
|
|
@@ -3637,7 +3617,7 @@ var require_utils = __commonJS({
|
|
|
3637
3617
|
return _SectionMetadata2.toString();
|
|
3638
3618
|
};
|
|
3639
3619
|
return SectionMetadata;
|
|
3640
|
-
}(function(_ref2) {
|
|
3620
|
+
})(function(_ref2) {
|
|
3641
3621
|
var node = _ref2.node;
|
|
3642
3622
|
if (node.section === name) {
|
|
3643
3623
|
sections.push(node);
|
|
@@ -3799,10 +3779,8 @@ var require_utils = __commonJS({
|
|
|
3799
3779
|
}
|
|
3800
3780
|
}
|
|
3801
3781
|
});
|
|
3802
|
-
|
|
3803
|
-
// node_modules/.pnpm/@webassemblyjs+ast@1.12.1/node_modules/@webassemblyjs/ast/lib/clone.js
|
|
3804
3782
|
var require_clone = __commonJS({
|
|
3805
|
-
"node_modules/.pnpm/@webassemblyjs+ast@1.
|
|
3783
|
+
"node_modules/.pnpm/@webassemblyjs+ast@1.14.1/node_modules/@webassemblyjs/ast/lib/clone.js"(exports) {
|
|
3806
3784
|
Object.defineProperty(exports, "__esModule", {
|
|
3807
3785
|
value: true
|
|
3808
3786
|
});
|
|
@@ -3812,10 +3790,8 @@ var require_clone = __commonJS({
|
|
|
3812
3790
|
}
|
|
3813
3791
|
}
|
|
3814
3792
|
});
|
|
3815
|
-
|
|
3816
|
-
// node_modules/.pnpm/@webassemblyjs+ast@1.12.1/node_modules/@webassemblyjs/ast/lib/transform/ast-module-to-module-context/index.js
|
|
3817
3793
|
var require_ast_module_to_module_context = __commonJS({
|
|
3818
|
-
"node_modules/.pnpm/@webassemblyjs+ast@1.
|
|
3794
|
+
"node_modules/.pnpm/@webassemblyjs+ast@1.14.1/node_modules/@webassemblyjs/ast/lib/transform/ast-module-to-module-context/index.js"(exports) {
|
|
3819
3795
|
Object.defineProperty(exports, "__esModule", {
|
|
3820
3796
|
value: true
|
|
3821
3797
|
});
|
|
@@ -3832,16 +3808,12 @@ var require_ast_module_to_module_context = __commonJS({
|
|
|
3832
3808
|
var descriptor = props[i];
|
|
3833
3809
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
3834
3810
|
descriptor.configurable = true;
|
|
3835
|
-
if ("value" in descriptor)
|
|
3836
|
-
descriptor.writable = true;
|
|
3811
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
3837
3812
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
3838
3813
|
}
|
|
3839
3814
|
}
|
|
3840
3815
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
3841
|
-
if (protoProps)
|
|
3842
|
-
_defineProperties(Constructor.prototype, protoProps);
|
|
3843
|
-
if (staticProps)
|
|
3844
|
-
_defineProperties(Constructor, staticProps);
|
|
3816
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
3845
3817
|
return Constructor;
|
|
3846
3818
|
}
|
|
3847
3819
|
function moduleContextFromModuleAST(m) {
|
|
@@ -3897,7 +3869,7 @@ var require_ast_module_to_module_context = __commonJS({
|
|
|
3897
3869
|
});
|
|
3898
3870
|
return moduleContext;
|
|
3899
3871
|
}
|
|
3900
|
-
var ModuleContext = /* @__PURE__ */ function() {
|
|
3872
|
+
var ModuleContext = /* @__PURE__ */ (function() {
|
|
3901
3873
|
function ModuleContext2() {
|
|
3902
3874
|
_classCallCheck(this, ModuleContext2);
|
|
3903
3875
|
this.funcs = [];
|
|
@@ -4144,14 +4116,12 @@ var require_ast_module_to_module_context = __commonJS({
|
|
|
4144
4116
|
}
|
|
4145
4117
|
}]);
|
|
4146
4118
|
return ModuleContext2;
|
|
4147
|
-
}();
|
|
4119
|
+
})();
|
|
4148
4120
|
exports.ModuleContext = ModuleContext;
|
|
4149
4121
|
}
|
|
4150
4122
|
});
|
|
4151
|
-
|
|
4152
|
-
// node_modules/.pnpm/@webassemblyjs+ast@1.12.1/node_modules/@webassemblyjs/ast/lib/index.js
|
|
4153
4123
|
var require_lib7 = __commonJS({
|
|
4154
|
-
"node_modules/.pnpm/@webassemblyjs+ast@1.
|
|
4124
|
+
"node_modules/.pnpm/@webassemblyjs+ast@1.14.1/node_modules/@webassemblyjs/ast/lib/index.js"(exports) {
|
|
4155
4125
|
Object.defineProperty(exports, "__esModule", {
|
|
4156
4126
|
value: true
|
|
4157
4127
|
});
|
|
@@ -4243,12 +4213,9 @@ var require_lib7 = __commonJS({
|
|
|
4243
4213
|
});
|
|
4244
4214
|
var _nodes = require_nodes();
|
|
4245
4215
|
Object.keys(_nodes).forEach(function(key) {
|
|
4246
|
-
if (key === "default" || key === "__esModule")
|
|
4247
|
-
|
|
4248
|
-
if (
|
|
4249
|
-
return;
|
|
4250
|
-
if (key in exports && exports[key] === _nodes[key])
|
|
4251
|
-
return;
|
|
4216
|
+
if (key === "default" || key === "__esModule") return;
|
|
4217
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
4218
|
+
if (key in exports && exports[key] === _nodes[key]) return;
|
|
4252
4219
|
Object.defineProperty(exports, key, {
|
|
4253
4220
|
enumerable: true,
|
|
4254
4221
|
get: function get() {
|
|
@@ -4261,12 +4228,9 @@ var require_lib7 = __commonJS({
|
|
|
4261
4228
|
var _signatures = require_signatures();
|
|
4262
4229
|
var _utils = require_utils();
|
|
4263
4230
|
Object.keys(_utils).forEach(function(key) {
|
|
4264
|
-
if (key === "default" || key === "__esModule")
|
|
4265
|
-
|
|
4266
|
-
if (
|
|
4267
|
-
return;
|
|
4268
|
-
if (key in exports && exports[key] === _utils[key])
|
|
4269
|
-
return;
|
|
4231
|
+
if (key === "default" || key === "__esModule") return;
|
|
4232
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
4233
|
+
if (key in exports && exports[key] === _utils[key]) return;
|
|
4270
4234
|
Object.defineProperty(exports, key, {
|
|
4271
4235
|
enumerable: true,
|
|
4272
4236
|
get: function get() {
|
|
@@ -4278,10 +4242,8 @@ var require_lib7 = __commonJS({
|
|
|
4278
4242
|
var _astModuleToModuleContext = require_ast_module_to_module_context();
|
|
4279
4243
|
}
|
|
4280
4244
|
});
|
|
4281
|
-
|
|
4282
|
-
// node_modules/.pnpm/@webassemblyjs+leb128@1.12.1/node_modules/@webassemblyjs/leb128/lib/bits.js
|
|
4283
4245
|
var require_bits = __commonJS({
|
|
4284
|
-
"node_modules/.pnpm/@webassemblyjs+leb128@1.
|
|
4246
|
+
"node_modules/.pnpm/@webassemblyjs+leb128@1.14.1/node_modules/@webassemblyjs/leb128/lib/bits.js"(exports) {
|
|
4285
4247
|
Object.defineProperty(exports, "__esModule", {
|
|
4286
4248
|
value: true
|
|
4287
4249
|
});
|
|
@@ -4367,10 +4329,8 @@ var require_bits = __commonJS({
|
|
|
4367
4329
|
}
|
|
4368
4330
|
}
|
|
4369
4331
|
});
|
|
4370
|
-
|
|
4371
|
-
// node_modules/.pnpm/@webassemblyjs+leb128@1.12.1/node_modules/@webassemblyjs/leb128/lib/bufs.js
|
|
4372
4332
|
var require_bufs = __commonJS({
|
|
4373
|
-
"node_modules/.pnpm/@webassemblyjs+leb128@1.
|
|
4333
|
+
"node_modules/.pnpm/@webassemblyjs+leb128@1.14.1/node_modules/@webassemblyjs/leb128/lib/bufs.js"(exports) {
|
|
4374
4334
|
Object.defineProperty(exports, "__esModule", {
|
|
4375
4335
|
value: true
|
|
4376
4336
|
});
|
|
@@ -4505,10 +4465,8 @@ var require_bufs = __commonJS({
|
|
|
4505
4465
|
}
|
|
4506
4466
|
}
|
|
4507
4467
|
});
|
|
4508
|
-
|
|
4509
|
-
// node_modules/.pnpm/@webassemblyjs+leb128@1.12.1/node_modules/@webassemblyjs/leb128/lib/leb.js
|
|
4510
4468
|
var require_leb = __commonJS({
|
|
4511
|
-
"node_modules/.pnpm/@webassemblyjs+leb128@1.
|
|
4469
|
+
"node_modules/.pnpm/@webassemblyjs+leb128@1.14.1/node_modules/@webassemblyjs/leb128/lib/leb.js"(exports) {
|
|
4512
4470
|
function _typeof(obj) {
|
|
4513
4471
|
"@babel/helpers - typeof";
|
|
4514
4472
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
@@ -4530,8 +4488,7 @@ var require_leb = __commonJS({
|
|
|
4530
4488
|
var bits = _interopRequireWildcard(require_bits());
|
|
4531
4489
|
var bufs = _interopRequireWildcard(require_bufs());
|
|
4532
4490
|
function _getRequireWildcardCache(nodeInterop) {
|
|
4533
|
-
if (typeof WeakMap !== "function")
|
|
4534
|
-
return null;
|
|
4491
|
+
if (typeof WeakMap !== "function") return null;
|
|
4535
4492
|
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
|
|
4536
4493
|
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
|
4537
4494
|
return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
|
|
@@ -4539,7 +4496,7 @@ var require_leb = __commonJS({
|
|
|
4539
4496
|
})(nodeInterop);
|
|
4540
4497
|
}
|
|
4541
4498
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
4542
|
-
if (
|
|
4499
|
+
if (obj && obj.__esModule) {
|
|
4543
4500
|
return obj;
|
|
4544
4501
|
}
|
|
4545
4502
|
if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
|
|
@@ -4757,10 +4714,8 @@ var require_leb = __commonJS({
|
|
|
4757
4714
|
exports["default"] = _default;
|
|
4758
4715
|
}
|
|
4759
4716
|
});
|
|
4760
|
-
|
|
4761
|
-
// node_modules/.pnpm/@webassemblyjs+leb128@1.12.1/node_modules/@webassemblyjs/leb128/lib/index.js
|
|
4762
4717
|
var require_lib8 = __commonJS({
|
|
4763
|
-
"node_modules/.pnpm/@webassemblyjs+leb128@1.
|
|
4718
|
+
"node_modules/.pnpm/@webassemblyjs+leb128@1.14.1/node_modules/@webassemblyjs/leb128/lib/index.js"(exports) {
|
|
4764
4719
|
Object.defineProperty(exports, "__esModule", {
|
|
4765
4720
|
value: true
|
|
4766
4721
|
});
|
|
@@ -4803,10 +4758,8 @@ var require_lib8 = __commonJS({
|
|
|
4803
4758
|
}
|
|
4804
4759
|
}
|
|
4805
4760
|
});
|
|
4806
|
-
|
|
4807
|
-
// node_modules/.pnpm/@webassemblyjs+wasm-parser@1.12.1/node_modules/@webassemblyjs/wasm-parser/lib/decoder.js
|
|
4808
4761
|
var require_decoder2 = __commonJS({
|
|
4809
|
-
"node_modules/.pnpm/@webassemblyjs+wasm-parser@1.
|
|
4762
|
+
"node_modules/.pnpm/@webassemblyjs+wasm-parser@1.14.1/node_modules/@webassemblyjs/wasm-parser/lib/decoder.js"(exports) {
|
|
4810
4763
|
function _typeof(obj) {
|
|
4811
4764
|
"@babel/helpers - typeof";
|
|
4812
4765
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
@@ -4834,8 +4787,7 @@ var require_decoder2 = __commonJS({
|
|
|
4834
4787
|
return obj && obj.__esModule ? obj : { "default": obj };
|
|
4835
4788
|
}
|
|
4836
4789
|
function _getRequireWildcardCache(nodeInterop) {
|
|
4837
|
-
if (typeof WeakMap !== "function")
|
|
4838
|
-
return null;
|
|
4790
|
+
if (typeof WeakMap !== "function") return null;
|
|
4839
4791
|
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
|
|
4840
4792
|
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
|
4841
4793
|
return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
|
|
@@ -4843,7 +4795,7 @@ var require_decoder2 = __commonJS({
|
|
|
4843
4795
|
})(nodeInterop);
|
|
4844
4796
|
}
|
|
4845
4797
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
4846
|
-
if (
|
|
4798
|
+
if (obj && obj.__esModule) {
|
|
4847
4799
|
return obj;
|
|
4848
4800
|
}
|
|
4849
4801
|
if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
|
|
@@ -4878,29 +4830,21 @@ var require_decoder2 = __commonJS({
|
|
|
4878
4830
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4879
4831
|
}
|
|
4880
4832
|
function _unsupportedIterableToArray(o, minLen) {
|
|
4881
|
-
if (!o)
|
|
4882
|
-
|
|
4883
|
-
if (typeof o === "string")
|
|
4884
|
-
return _arrayLikeToArray(o, minLen);
|
|
4833
|
+
if (!o) return;
|
|
4834
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
4885
4835
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
4886
|
-
if (n === "Object" && o.constructor)
|
|
4887
|
-
|
|
4888
|
-
if (n === "
|
|
4889
|
-
return Array.from(o);
|
|
4890
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
4891
|
-
return _arrayLikeToArray(o, minLen);
|
|
4836
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
4837
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
4838
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
4892
4839
|
}
|
|
4893
4840
|
function _iterableToArray(iter) {
|
|
4894
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
4895
|
-
return Array.from(iter);
|
|
4841
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
4896
4842
|
}
|
|
4897
4843
|
function _arrayWithoutHoles(arr) {
|
|
4898
|
-
if (Array.isArray(arr))
|
|
4899
|
-
return _arrayLikeToArray(arr);
|
|
4844
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
4900
4845
|
}
|
|
4901
4846
|
function _arrayLikeToArray(arr, len) {
|
|
4902
|
-
if (len == null || len > arr.length)
|
|
4903
|
-
len = arr.length;
|
|
4847
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
4904
4848
|
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
4905
4849
|
arr2[i] = arr[i];
|
|
4906
4850
|
}
|
|
@@ -4931,8 +4875,7 @@ var require_decoder2 = __commonJS({
|
|
|
4931
4875
|
};
|
|
4932
4876
|
}
|
|
4933
4877
|
function dump(b, msg) {
|
|
4934
|
-
if (opts.dump === false)
|
|
4935
|
-
return;
|
|
4878
|
+
if (opts.dump === false) return;
|
|
4936
4879
|
var pad = " ";
|
|
4937
4880
|
var str = "";
|
|
4938
4881
|
if (b.length < 5) {
|
|
@@ -4943,12 +4886,10 @@ var require_decoder2 = __commonJS({
|
|
|
4943
4886
|
console.log(toHex(offset) + ": ", str, pad, ";", msg);
|
|
4944
4887
|
}
|
|
4945
4888
|
function dumpSep(msg) {
|
|
4946
|
-
if (opts.dump === false)
|
|
4947
|
-
return;
|
|
4889
|
+
if (opts.dump === false) return;
|
|
4948
4890
|
console.log(";", msg);
|
|
4949
4891
|
}
|
|
4950
4892
|
var state = {
|
|
4951
|
-
elementsInFuncSection: [],
|
|
4952
4893
|
elementsInExportSection: [],
|
|
4953
4894
|
elementsInCodeSection: [],
|
|
4954
4895
|
/**
|
|
@@ -5148,7 +5089,11 @@ var require_decoder2 = __commonJS({
|
|
|
5148
5089
|
if (type == _helperWasmBytecode["default"].types.func) {
|
|
5149
5090
|
dump([type], "func");
|
|
5150
5091
|
var paramValtypes = parseVec(function(b) {
|
|
5151
|
-
|
|
5092
|
+
var valtype = _helperWasmBytecode["default"].valtypes[b];
|
|
5093
|
+
if (valtype === void 0) {
|
|
5094
|
+
throw new Error("unexpected value type ".concat(b));
|
|
5095
|
+
}
|
|
5096
|
+
return valtype;
|
|
5152
5097
|
});
|
|
5153
5098
|
var params = paramValtypes.map(function(v) {
|
|
5154
5099
|
return t.funcParam(
|
|
@@ -5159,10 +5104,10 @@ var require_decoder2 = __commonJS({
|
|
|
5159
5104
|
var result = parseVec(function(b) {
|
|
5160
5105
|
return _helperWasmBytecode["default"].valtypes[b];
|
|
5161
5106
|
});
|
|
5162
|
-
typeInstructionNodes.push(function() {
|
|
5107
|
+
typeInstructionNodes.push((function() {
|
|
5163
5108
|
var endLoc = getPosition();
|
|
5164
5109
|
return t.withLoc(t.typeInstruction(void 0, t.signature(params, result)), endLoc, _startLoc);
|
|
5165
|
-
}());
|
|
5110
|
+
})());
|
|
5166
5111
|
state.typesInModule.push({
|
|
5167
5112
|
params,
|
|
5168
5113
|
result
|
|
@@ -5221,10 +5166,10 @@ var require_decoder2 = __commonJS({
|
|
|
5221
5166
|
} else {
|
|
5222
5167
|
throw new _helperApiError.CompileError("Unsupported import of type: " + descrType);
|
|
5223
5168
|
}
|
|
5224
|
-
imports.push(function() {
|
|
5169
|
+
imports.push((function() {
|
|
5225
5170
|
var endLoc = getPosition();
|
|
5226
5171
|
return t.withLoc(t.moduleImport(moduleName.value, name.value, importDescr), endLoc, _startLoc2);
|
|
5227
|
-
}());
|
|
5172
|
+
})());
|
|
5228
5173
|
}
|
|
5229
5174
|
return imports;
|
|
5230
5175
|
}
|
|
@@ -5333,10 +5278,10 @@ var require_decoder2 = __commonJS({
|
|
|
5333
5278
|
for (var _i2 = 0; _i2 < localCount; _i2++) {
|
|
5334
5279
|
args.push(t.valtypeLiteral(type));
|
|
5335
5280
|
}
|
|
5336
|
-
var localNode = function() {
|
|
5281
|
+
var localNode = (function() {
|
|
5337
5282
|
var endLoc2 = getPosition();
|
|
5338
5283
|
return t.withLoc(t.instruction("local", args), endLoc2, _startLoc5);
|
|
5339
|
-
}();
|
|
5284
|
+
})();
|
|
5340
5285
|
locals.push(localNode);
|
|
5341
5286
|
dump([valtypeByte], type);
|
|
5342
5287
|
if (typeof type === "undefined") {
|
|
@@ -5365,20 +5310,27 @@ var require_decoder2 = __commonJS({
|
|
|
5365
5310
|
instructionByte = 65024 + readByte();
|
|
5366
5311
|
eatBytes(1);
|
|
5367
5312
|
}
|
|
5313
|
+
if (instructionByte === 252) {
|
|
5314
|
+
instructionByte = 64512 + readByte();
|
|
5315
|
+
eatBytes(1);
|
|
5316
|
+
}
|
|
5368
5317
|
var instruction = _helperWasmBytecode["default"].symbolsByByte[instructionByte];
|
|
5369
5318
|
if (typeof instruction === "undefined") {
|
|
5370
5319
|
throw new _helperApiError.CompileError("Unexpected instruction: " + toHex(instructionByte));
|
|
5371
5320
|
}
|
|
5321
|
+
if (instruction === "illegal") {
|
|
5322
|
+
throw new Error("tried to decode an illegal bytecode: ".concat(toHex(instructionByte)));
|
|
5323
|
+
}
|
|
5372
5324
|
if (typeof instruction.object === "string") {
|
|
5373
5325
|
dump([instructionByte], "".concat(instruction.object, ".").concat(instruction.name));
|
|
5374
5326
|
} else {
|
|
5375
5327
|
dump([instructionByte], instruction.name);
|
|
5376
5328
|
}
|
|
5377
5329
|
if (instruction.name === "end") {
|
|
5378
|
-
var node = function() {
|
|
5330
|
+
var node = (function() {
|
|
5379
5331
|
var endLoc = getPosition();
|
|
5380
5332
|
return t.withLoc(t.instruction(instruction.name), endLoc, _startLoc6);
|
|
5381
|
-
}();
|
|
5333
|
+
})();
|
|
5382
5334
|
code.push(node);
|
|
5383
5335
|
break;
|
|
5384
5336
|
}
|
|
@@ -5386,31 +5338,19 @@ var require_decoder2 = __commonJS({
|
|
|
5386
5338
|
var namedArgs = void 0;
|
|
5387
5339
|
if (instruction.name === "loop") {
|
|
5388
5340
|
var _startLoc7 = getPosition();
|
|
5389
|
-
var
|
|
5390
|
-
eatBytes(1);
|
|
5391
|
-
var blocktype = _helperWasmBytecode["default"].blockTypes[blocktypeByte];
|
|
5392
|
-
dump([blocktypeByte], "blocktype");
|
|
5393
|
-
if (typeof blocktype === "undefined") {
|
|
5394
|
-
throw new _helperApiError.CompileError("Unexpected blocktype: " + toHex(blocktypeByte));
|
|
5395
|
-
}
|
|
5341
|
+
var blocktype = parseBlockType();
|
|
5396
5342
|
var instr = [];
|
|
5397
5343
|
parseInstructionBlock(instr);
|
|
5398
5344
|
var label = t.withRaw(t.identifier(getUniqueName("loop")), "");
|
|
5399
|
-
var loopNode = function() {
|
|
5345
|
+
var loopNode = (function() {
|
|
5400
5346
|
var endLoc = getPosition();
|
|
5401
5347
|
return t.withLoc(t.loopInstruction(label, blocktype, instr), endLoc, _startLoc7);
|
|
5402
|
-
}();
|
|
5348
|
+
})();
|
|
5403
5349
|
code.push(loopNode);
|
|
5404
5350
|
instructionAlreadyCreated = true;
|
|
5405
5351
|
} else if (instruction.name === "if") {
|
|
5406
5352
|
var _startLoc8 = getPosition();
|
|
5407
|
-
var
|
|
5408
|
-
eatBytes(1);
|
|
5409
|
-
var _blocktype = _helperWasmBytecode["default"].blockTypes[_blocktypeByte];
|
|
5410
|
-
dump([_blocktypeByte], "blocktype");
|
|
5411
|
-
if (typeof _blocktype === "undefined") {
|
|
5412
|
-
throw new _helperApiError.CompileError("Unexpected blocktype: " + toHex(_blocktypeByte));
|
|
5413
|
-
}
|
|
5353
|
+
var _blocktype = parseBlockType();
|
|
5414
5354
|
var testIndex = t.withRaw(t.identifier(getUniqueName("if")), "");
|
|
5415
5355
|
var ifBody = [];
|
|
5416
5356
|
parseInstructionBlock(ifBody);
|
|
@@ -5424,28 +5364,22 @@ var require_decoder2 = __commonJS({
|
|
|
5424
5364
|
var consequentInstr = ifBody.slice(0, elseIndex);
|
|
5425
5365
|
var alternate = ifBody.slice(elseIndex + 1);
|
|
5426
5366
|
var testInstrs = [];
|
|
5427
|
-
var ifNode = function() {
|
|
5367
|
+
var ifNode = (function() {
|
|
5428
5368
|
var endLoc = getPosition();
|
|
5429
5369
|
return t.withLoc(t.ifInstruction(testIndex, testInstrs, _blocktype, consequentInstr, alternate), endLoc, _startLoc8);
|
|
5430
|
-
}();
|
|
5370
|
+
})();
|
|
5431
5371
|
code.push(ifNode);
|
|
5432
5372
|
instructionAlreadyCreated = true;
|
|
5433
5373
|
} else if (instruction.name === "block") {
|
|
5434
5374
|
var _startLoc9 = getPosition();
|
|
5435
|
-
var
|
|
5436
|
-
eatBytes(1);
|
|
5437
|
-
var _blocktype2 = _helperWasmBytecode["default"].blockTypes[_blocktypeByte2];
|
|
5438
|
-
dump([_blocktypeByte2], "blocktype");
|
|
5439
|
-
if (typeof _blocktype2 === "undefined") {
|
|
5440
|
-
throw new _helperApiError.CompileError("Unexpected blocktype: " + toHex(_blocktypeByte2));
|
|
5441
|
-
}
|
|
5375
|
+
var _blocktype2 = parseBlockType();
|
|
5442
5376
|
var _instr2 = [];
|
|
5443
5377
|
parseInstructionBlock(_instr2);
|
|
5444
5378
|
var _label = t.withRaw(t.identifier(getUniqueName("block")), "");
|
|
5445
|
-
var blockNode = function() {
|
|
5379
|
+
var blockNode = (function() {
|
|
5446
5380
|
var endLoc = getPosition();
|
|
5447
5381
|
return t.withLoc(t.blockInstruction(_label, _instr2, _blocktype2), endLoc, _startLoc9);
|
|
5448
|
-
}();
|
|
5382
|
+
})();
|
|
5449
5383
|
code.push(blockNode);
|
|
5450
5384
|
instructionAlreadyCreated = true;
|
|
5451
5385
|
} else if (instruction.name === "call") {
|
|
@@ -5453,10 +5387,10 @@ var require_decoder2 = __commonJS({
|
|
|
5453
5387
|
var index = indexu32.value;
|
|
5454
5388
|
eatBytes(indexu32.nextIndex);
|
|
5455
5389
|
dump([index], "index");
|
|
5456
|
-
var callNode = function() {
|
|
5390
|
+
var callNode = (function() {
|
|
5457
5391
|
var endLoc = getPosition();
|
|
5458
5392
|
return t.withLoc(t.callInstruction(t.indexLiteral(index)), endLoc, _startLoc6);
|
|
5459
|
-
}();
|
|
5393
|
+
})();
|
|
5460
5394
|
code.push(callNode);
|
|
5461
5395
|
instructionAlreadyCreated = true;
|
|
5462
5396
|
} else if (instruction.name === "call_indirect") {
|
|
@@ -5476,10 +5410,10 @@ var require_decoder2 = __commonJS({
|
|
|
5476
5410
|
if (flag !== 0) {
|
|
5477
5411
|
throw new _helperApiError.CompileError("zero flag expected");
|
|
5478
5412
|
}
|
|
5479
|
-
code.push(function() {
|
|
5413
|
+
code.push((function() {
|
|
5480
5414
|
var endLoc = getPosition();
|
|
5481
5415
|
return t.withLoc(_callNode, endLoc, _startLoc10);
|
|
5482
|
-
}());
|
|
5416
|
+
})());
|
|
5483
5417
|
instructionAlreadyCreated = true;
|
|
5484
5418
|
} else if (instruction.name === "br_table") {
|
|
5485
5419
|
var indicesu32 = readU32();
|
|
@@ -5511,8 +5445,7 @@ var require_decoder2 = __commonJS({
|
|
|
5511
5445
|
var _offset2 = offsetu32.value;
|
|
5512
5446
|
eatBytes(offsetu32.nextIndex);
|
|
5513
5447
|
dump([_offset2], "offset");
|
|
5514
|
-
if (namedArgs === void 0)
|
|
5515
|
-
namedArgs = {};
|
|
5448
|
+
if (namedArgs === void 0) namedArgs = {};
|
|
5516
5449
|
namedArgs.offset = t.numberLiteralFromRaw(_offset2);
|
|
5517
5450
|
}
|
|
5518
5451
|
} else if (instructionByte >= 65 && instructionByte <= 68) {
|
|
@@ -5599,16 +5532,16 @@ var require_decoder2 = __commonJS({
|
|
|
5599
5532
|
}
|
|
5600
5533
|
if (instructionAlreadyCreated === false) {
|
|
5601
5534
|
if (typeof instruction.object === "string") {
|
|
5602
|
-
var _node3 = function() {
|
|
5535
|
+
var _node3 = (function() {
|
|
5603
5536
|
var endLoc = getPosition();
|
|
5604
5537
|
return t.withLoc(t.objectInstruction(instruction.name, instruction.object, args, namedArgs), endLoc, _startLoc6);
|
|
5605
|
-
}();
|
|
5538
|
+
})();
|
|
5606
5539
|
code.push(_node3);
|
|
5607
5540
|
} else {
|
|
5608
|
-
var _node4 = function() {
|
|
5541
|
+
var _node4 = (function() {
|
|
5609
5542
|
var endLoc = getPosition();
|
|
5610
5543
|
return t.withLoc(t.instruction(instruction.name, args, namedArgs), endLoc, _startLoc6);
|
|
5611
|
-
}();
|
|
5544
|
+
})();
|
|
5612
5545
|
code.push(_node4);
|
|
5613
5546
|
}
|
|
5614
5547
|
}
|
|
@@ -5645,7 +5578,7 @@ var require_decoder2 = __commonJS({
|
|
|
5645
5578
|
dump([elementTypeByte], "element type");
|
|
5646
5579
|
var elementType = _helperWasmBytecode["default"].tableTypes[elementTypeByte];
|
|
5647
5580
|
if (typeof elementType === "undefined") {
|
|
5648
|
-
throw new _helperApiError.CompileError("Unknown element type in table: " + toHex(
|
|
5581
|
+
throw new _helperApiError.CompileError("Unknown element type in table: " + toHex(elementTypeByte));
|
|
5649
5582
|
}
|
|
5650
5583
|
var limits = parseLimits();
|
|
5651
5584
|
return t.table(elementType, limits, name);
|
|
@@ -5714,6 +5647,16 @@ var require_decoder2 = __commonJS({
|
|
|
5714
5647
|
var subSectionSizeInBytesu32 = readVaruint32();
|
|
5715
5648
|
eatBytes(subSectionSizeInBytesu32.nextIndex);
|
|
5716
5649
|
switch (sectionTypeByte.value) {
|
|
5650
|
+
// case 0: {
|
|
5651
|
+
// TODO(sven): re-enable that
|
|
5652
|
+
// Current status: it seems that when we decode the module's name
|
|
5653
|
+
// no name_payload_len is used.
|
|
5654
|
+
//
|
|
5655
|
+
// See https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md#name-section
|
|
5656
|
+
//
|
|
5657
|
+
// nameMetadata.push(...parseNameModule());
|
|
5658
|
+
// break;
|
|
5659
|
+
// }
|
|
5717
5660
|
case 1: {
|
|
5718
5661
|
nameMetadata.push.apply(nameMetadata, _toConsumableArray(parseNameSectionFunctions()));
|
|
5719
5662
|
break;
|
|
@@ -5763,10 +5706,10 @@ var require_decoder2 = __commonJS({
|
|
|
5763
5706
|
var globalType = parseGlobalType();
|
|
5764
5707
|
var init = [];
|
|
5765
5708
|
parseInstructionBlock(init);
|
|
5766
|
-
var node = function() {
|
|
5709
|
+
var node = (function() {
|
|
5767
5710
|
var endLoc = getPosition();
|
|
5768
5711
|
return t.withLoc(t.global(globalType, init), endLoc, _startLoc11);
|
|
5769
|
-
}();
|
|
5712
|
+
})();
|
|
5770
5713
|
globals.push(node);
|
|
5771
5714
|
state.globalsInModule.push(node);
|
|
5772
5715
|
}
|
|
@@ -5778,28 +5721,130 @@ var require_decoder2 = __commonJS({
|
|
|
5778
5721
|
for (var i = 0; i < numberOfElements; i++) {
|
|
5779
5722
|
var _startLoc12 = getPosition();
|
|
5780
5723
|
var tableindexu32 = readU32();
|
|
5781
|
-
var
|
|
5724
|
+
var bitfield = tableindexu32.value;
|
|
5782
5725
|
eatBytes(tableindexu32.nextIndex);
|
|
5783
|
-
dump([
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
var
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5726
|
+
dump([bitfield], "bitfield");
|
|
5727
|
+
if (bitfield === 0) {
|
|
5728
|
+
var instr = [];
|
|
5729
|
+
parseInstructionBlock(instr);
|
|
5730
|
+
var indicesu32 = readU32();
|
|
5731
|
+
var indices = indicesu32.value;
|
|
5732
|
+
eatBytes(indicesu32.nextIndex);
|
|
5733
|
+
dump([indices], "num indices");
|
|
5734
|
+
var indexValues = [];
|
|
5735
|
+
for (var _i5 = 0; _i5 < indices; _i5++) {
|
|
5736
|
+
var indexu32 = readU32();
|
|
5737
|
+
var index = indexu32.value;
|
|
5738
|
+
eatBytes(indexu32.nextIndex);
|
|
5739
|
+
dump([index], "index");
|
|
5740
|
+
indexValues.push(t.indexLiteral(index));
|
|
5741
|
+
}
|
|
5742
|
+
var elemNode = (function() {
|
|
5743
|
+
var endLoc = getPosition();
|
|
5744
|
+
return t.withLoc(t.elem(t.indexLiteral(bitfield), instr, indexValues), endLoc, _startLoc12);
|
|
5745
|
+
})();
|
|
5746
|
+
elems.push(elemNode);
|
|
5747
|
+
} else if (bitfield === 1) {
|
|
5748
|
+
var elemKind = readByte();
|
|
5749
|
+
eatBytes(1);
|
|
5750
|
+
if (elemKind !== 0) {
|
|
5751
|
+
throw new Error("unexpected Elem kind: ".concat(toHex(elemKind)));
|
|
5752
|
+
}
|
|
5753
|
+
var _indicesu = readU32();
|
|
5754
|
+
var _indices = _indicesu.value;
|
|
5755
|
+
eatBytes(_indicesu.nextIndex);
|
|
5756
|
+
dump([_indices], "num indices");
|
|
5757
|
+
var _indexValues = [];
|
|
5758
|
+
for (var _i6 = 0; _i6 < _indices; _i6++) {
|
|
5759
|
+
var _indexu2 = readU32();
|
|
5760
|
+
var _index3 = _indexu2.value;
|
|
5761
|
+
eatBytes(_indexu2.nextIndex);
|
|
5762
|
+
dump([_index3], "index");
|
|
5763
|
+
_indexValues.push(t.indexLiteral(_index3));
|
|
5764
|
+
}
|
|
5765
|
+
} else if (bitfield === 2) {
|
|
5766
|
+
var u32 = readU32();
|
|
5767
|
+
var tableidx = u32.value;
|
|
5768
|
+
eatBytes(u32.nextIndex);
|
|
5769
|
+
dump([tableidx], "tableidx");
|
|
5770
|
+
var _instr3 = [];
|
|
5771
|
+
parseInstructionBlock(_instr3);
|
|
5772
|
+
var _elemKind = readByte();
|
|
5773
|
+
eatBytes(1);
|
|
5774
|
+
if (_elemKind !== 0) {
|
|
5775
|
+
throw new Error("unexpected Elem kind: ".concat(toHex(_elemKind)));
|
|
5776
|
+
}
|
|
5777
|
+
var _indicesu2 = readU32();
|
|
5778
|
+
var _indices2 = _indicesu2.value;
|
|
5779
|
+
eatBytes(_indicesu2.nextIndex);
|
|
5780
|
+
dump([_indices2], "num indices");
|
|
5781
|
+
var _indexValues2 = [];
|
|
5782
|
+
for (var _i7 = 0; _i7 < _indices2; _i7++) {
|
|
5783
|
+
var _indexu3 = readU32();
|
|
5784
|
+
var _index4 = _indexu3.value;
|
|
5785
|
+
eatBytes(_indexu3.nextIndex);
|
|
5786
|
+
dump([_index4], "index");
|
|
5787
|
+
_indexValues2.push(t.indexLiteral(_index4));
|
|
5788
|
+
}
|
|
5789
|
+
var _elemNode = (function() {
|
|
5790
|
+
var endLoc = getPosition();
|
|
5791
|
+
return t.withLoc(t.elem(t.indexLiteral(bitfield), _instr3, _indexValues2), endLoc, _startLoc12);
|
|
5792
|
+
})();
|
|
5793
|
+
elems.push(_elemNode);
|
|
5794
|
+
} else if (bitfield === 3) {
|
|
5795
|
+
var _elemKind2 = readByte();
|
|
5796
|
+
eatBytes(1);
|
|
5797
|
+
if (_elemKind2 !== 0) {
|
|
5798
|
+
throw new Error("unexpected Elem kind: ".concat(toHex(_elemKind2)));
|
|
5799
|
+
}
|
|
5800
|
+
var countU32 = readU32();
|
|
5801
|
+
var count = countU32.value;
|
|
5802
|
+
eatBytes(countU32.nextIndex);
|
|
5803
|
+
dump([count], "count");
|
|
5804
|
+
for (var _i8 = 0; _i8 < count; _i8++) {
|
|
5805
|
+
var _indexu4 = readU32();
|
|
5806
|
+
var _index5 = _indexu4.value;
|
|
5807
|
+
eatBytes(_indexu4.nextIndex);
|
|
5808
|
+
dump([_index5], "index");
|
|
5809
|
+
}
|
|
5810
|
+
} else if (bitfield === 4) {
|
|
5811
|
+
var expr = [];
|
|
5812
|
+
parseInstructionBlock(expr);
|
|
5813
|
+
var _countU = readU32();
|
|
5814
|
+
var _count = _countU.value;
|
|
5815
|
+
eatBytes(_countU.nextIndex);
|
|
5816
|
+
dump([_count], "count");
|
|
5817
|
+
for (var _i9 = 0; _i9 < _count; _i9++) {
|
|
5818
|
+
var code = [];
|
|
5819
|
+
parseInstructionBlock(code);
|
|
5820
|
+
}
|
|
5821
|
+
} else if (bitfield === 5) {
|
|
5822
|
+
var reftype = readByte();
|
|
5823
|
+
eatBytes(1);
|
|
5824
|
+
dump([reftype], "reftype");
|
|
5825
|
+
var _countU2 = readU32();
|
|
5826
|
+
var _count2 = _countU2.value;
|
|
5827
|
+
eatBytes(_countU2.nextIndex);
|
|
5828
|
+
dump([_count2], "count");
|
|
5829
|
+
for (var _i10 = 0; _i10 < _count2; _i10++) {
|
|
5830
|
+
var _code = [];
|
|
5831
|
+
parseInstructionBlock(_code);
|
|
5832
|
+
}
|
|
5833
|
+
} else if (bitfield === 7) {
|
|
5834
|
+
var _reftype = readByte();
|
|
5835
|
+
eatBytes(1);
|
|
5836
|
+
dump([_reftype], "reftype");
|
|
5837
|
+
var _countU3 = readU32();
|
|
5838
|
+
var _count3 = _countU3.value;
|
|
5839
|
+
eatBytes(_countU3.nextIndex);
|
|
5840
|
+
dump([_count3], "count");
|
|
5841
|
+
for (var _i11 = 0; _i11 < _count3; _i11++) {
|
|
5842
|
+
var _code2 = [];
|
|
5843
|
+
parseInstructionBlock(_code2);
|
|
5844
|
+
}
|
|
5845
|
+
} else {
|
|
5846
|
+
throw new Error("unexpected Elem with bitfield ".concat(toHex(bitfield)));
|
|
5797
5847
|
}
|
|
5798
|
-
var elemNode = function() {
|
|
5799
|
-
var endLoc = getPosition();
|
|
5800
|
-
return t.withLoc(t.elem(t.indexLiteral(tableindex), instr, indexValues), endLoc, _startLoc12);
|
|
5801
|
-
}();
|
|
5802
|
-
elems.push(elemNode);
|
|
5803
5848
|
}
|
|
5804
5849
|
return elems;
|
|
5805
5850
|
}
|
|
@@ -5833,10 +5878,10 @@ var require_decoder2 = __commonJS({
|
|
|
5833
5878
|
var startFuncIndex = u32.value;
|
|
5834
5879
|
eatBytes(u32.nextIndex);
|
|
5835
5880
|
dump([startFuncIndex], "index");
|
|
5836
|
-
return function() {
|
|
5881
|
+
return (function() {
|
|
5837
5882
|
var endLoc = getPosition();
|
|
5838
5883
|
return t.withLoc(t.start(t.indexLiteral(startFuncIndex)), endLoc, startLoc);
|
|
5839
|
-
}();
|
|
5884
|
+
})();
|
|
5840
5885
|
}
|
|
5841
5886
|
function parseDataSection(numberOfElements) {
|
|
5842
5887
|
var dataEntries = [];
|
|
@@ -5868,8 +5913,7 @@ var require_decoder2 = __commonJS({
|
|
|
5868
5913
|
if (sectionId >= sectionIndex2 || sectionIndex2 === _helperWasmBytecode["default"].sections.custom) {
|
|
5869
5914
|
sectionIndex2 = sectionId + 1;
|
|
5870
5915
|
} else {
|
|
5871
|
-
if (sectionId !== _helperWasmBytecode["default"].sections.custom)
|
|
5872
|
-
throw new _helperApiError.CompileError("Unexpected section: " + toHex(sectionId));
|
|
5916
|
+
if (sectionId !== _helperWasmBytecode["default"].sections.custom) throw new _helperApiError.CompileError("Unexpected section: " + toHex(sectionId));
|
|
5873
5917
|
}
|
|
5874
5918
|
var nextSectionIndex2 = sectionIndex2;
|
|
5875
5919
|
var startOffset = offset;
|
|
@@ -5877,10 +5921,10 @@ var require_decoder2 = __commonJS({
|
|
|
5877
5921
|
var u32 = readU32();
|
|
5878
5922
|
var sectionSizeInBytes = u32.value;
|
|
5879
5923
|
eatBytes(u32.nextIndex);
|
|
5880
|
-
var sectionSizeInBytesNode = function() {
|
|
5924
|
+
var sectionSizeInBytesNode = (function() {
|
|
5881
5925
|
var endLoc = getPosition();
|
|
5882
5926
|
return t.withLoc(t.numberLiteralFromRaw(sectionSizeInBytes), endLoc, startLoc);
|
|
5883
|
-
}();
|
|
5927
|
+
})();
|
|
5884
5928
|
switch (sectionId) {
|
|
5885
5929
|
case _helperWasmBytecode["default"].sections.type: {
|
|
5886
5930
|
dumpSep("section Type");
|
|
@@ -5890,10 +5934,10 @@ var require_decoder2 = __commonJS({
|
|
|
5890
5934
|
var _u = readU32();
|
|
5891
5935
|
var numberOfTypes = _u.value;
|
|
5892
5936
|
eatBytes(_u.nextIndex);
|
|
5893
|
-
var metadata2 = t.sectionMetadata("type", startOffset, sectionSizeInBytesNode, function() {
|
|
5937
|
+
var metadata2 = t.sectionMetadata("type", startOffset, sectionSizeInBytesNode, (function() {
|
|
5894
5938
|
var endLoc = getPosition();
|
|
5895
5939
|
return t.withLoc(t.numberLiteralFromRaw(numberOfTypes), endLoc, _startLoc13);
|
|
5896
|
-
}());
|
|
5940
|
+
})());
|
|
5897
5941
|
var nodes2 = parseTypeSection(numberOfTypes);
|
|
5898
5942
|
return {
|
|
5899
5943
|
nodes: nodes2,
|
|
@@ -5910,10 +5954,10 @@ var require_decoder2 = __commonJS({
|
|
|
5910
5954
|
var numberOfTable = _u2.value;
|
|
5911
5955
|
eatBytes(_u2.nextIndex);
|
|
5912
5956
|
dump([numberOfTable], "num tables");
|
|
5913
|
-
var _metadata = t.sectionMetadata("table", startOffset, sectionSizeInBytesNode, function() {
|
|
5957
|
+
var _metadata = t.sectionMetadata("table", startOffset, sectionSizeInBytesNode, (function() {
|
|
5914
5958
|
var endLoc = getPosition();
|
|
5915
5959
|
return t.withLoc(t.numberLiteralFromRaw(numberOfTable), endLoc, _startLoc14);
|
|
5916
|
-
}());
|
|
5960
|
+
})());
|
|
5917
5961
|
var _nodes = parseTableSection(numberOfTable);
|
|
5918
5962
|
return {
|
|
5919
5963
|
nodes: _nodes,
|
|
@@ -5930,10 +5974,10 @@ var require_decoder2 = __commonJS({
|
|
|
5930
5974
|
var numberOfImports = numberOfImportsu32.value;
|
|
5931
5975
|
eatBytes(numberOfImportsu32.nextIndex);
|
|
5932
5976
|
dump([numberOfImports], "number of imports");
|
|
5933
|
-
var _metadata2 = t.sectionMetadata("import", startOffset, sectionSizeInBytesNode, function() {
|
|
5977
|
+
var _metadata2 = t.sectionMetadata("import", startOffset, sectionSizeInBytesNode, (function() {
|
|
5934
5978
|
var endLoc = getPosition();
|
|
5935
5979
|
return t.withLoc(t.numberLiteralFromRaw(numberOfImports), endLoc, _startLoc15);
|
|
5936
|
-
}());
|
|
5980
|
+
})());
|
|
5937
5981
|
var _nodes2 = parseImportSection(numberOfImports);
|
|
5938
5982
|
return {
|
|
5939
5983
|
nodes: _nodes2,
|
|
@@ -5949,10 +5993,10 @@ var require_decoder2 = __commonJS({
|
|
|
5949
5993
|
var numberOfFunctionsu32 = readU32();
|
|
5950
5994
|
var numberOfFunctions = numberOfFunctionsu32.value;
|
|
5951
5995
|
eatBytes(numberOfFunctionsu32.nextIndex);
|
|
5952
|
-
var _metadata3 = t.sectionMetadata("func", startOffset, sectionSizeInBytesNode, function() {
|
|
5996
|
+
var _metadata3 = t.sectionMetadata("func", startOffset, sectionSizeInBytesNode, (function() {
|
|
5953
5997
|
var endLoc = getPosition();
|
|
5954
5998
|
return t.withLoc(t.numberLiteralFromRaw(numberOfFunctions), endLoc, _startLoc16);
|
|
5955
|
-
}());
|
|
5999
|
+
})());
|
|
5956
6000
|
parseFuncSection(numberOfFunctions);
|
|
5957
6001
|
var _nodes3 = [];
|
|
5958
6002
|
return {
|
|
@@ -5969,10 +6013,10 @@ var require_decoder2 = __commonJS({
|
|
|
5969
6013
|
var _u3 = readU32();
|
|
5970
6014
|
var numberOfExport = _u3.value;
|
|
5971
6015
|
eatBytes(_u3.nextIndex);
|
|
5972
|
-
var _metadata4 = t.sectionMetadata("export", startOffset, sectionSizeInBytesNode, function() {
|
|
6016
|
+
var _metadata4 = t.sectionMetadata("export", startOffset, sectionSizeInBytesNode, (function() {
|
|
5973
6017
|
var endLoc = getPosition();
|
|
5974
6018
|
return t.withLoc(t.numberLiteralFromRaw(numberOfExport), endLoc, _startLoc17);
|
|
5975
|
-
}());
|
|
6019
|
+
})());
|
|
5976
6020
|
parseExportSection(numberOfExport);
|
|
5977
6021
|
var _nodes4 = [];
|
|
5978
6022
|
return {
|
|
@@ -5989,10 +6033,10 @@ var require_decoder2 = __commonJS({
|
|
|
5989
6033
|
var _u4 = readU32();
|
|
5990
6034
|
var numberOfFuncs = _u4.value;
|
|
5991
6035
|
eatBytes(_u4.nextIndex);
|
|
5992
|
-
var _metadata5 = t.sectionMetadata("code", startOffset, sectionSizeInBytesNode, function() {
|
|
6036
|
+
var _metadata5 = t.sectionMetadata("code", startOffset, sectionSizeInBytesNode, (function() {
|
|
5993
6037
|
var endLoc = getPosition();
|
|
5994
6038
|
return t.withLoc(t.numberLiteralFromRaw(numberOfFuncs), endLoc, _startLoc18);
|
|
5995
|
-
}());
|
|
6039
|
+
})());
|
|
5996
6040
|
if (opts.ignoreCodeSection === true) {
|
|
5997
6041
|
var remainingBytes = sectionSizeInBytes - _u4.nextIndex;
|
|
5998
6042
|
eatBytes(remainingBytes);
|
|
@@ -6026,10 +6070,10 @@ var require_decoder2 = __commonJS({
|
|
|
6026
6070
|
var numberOfElementsu32 = readU32();
|
|
6027
6071
|
var numberOfElements = numberOfElementsu32.value;
|
|
6028
6072
|
eatBytes(numberOfElementsu32.nextIndex);
|
|
6029
|
-
var _metadata7 = t.sectionMetadata("element", startOffset, sectionSizeInBytesNode, function() {
|
|
6073
|
+
var _metadata7 = t.sectionMetadata("element", startOffset, sectionSizeInBytesNode, (function() {
|
|
6030
6074
|
var endLoc = getPosition();
|
|
6031
6075
|
return t.withLoc(t.numberLiteralFromRaw(numberOfElements), endLoc, _startLoc19);
|
|
6032
|
-
}());
|
|
6076
|
+
})());
|
|
6033
6077
|
var _nodes7 = parseElemSection(numberOfElements);
|
|
6034
6078
|
return {
|
|
6035
6079
|
nodes: _nodes7,
|
|
@@ -6045,10 +6089,10 @@ var require_decoder2 = __commonJS({
|
|
|
6045
6089
|
var numberOfGlobalsu32 = readU32();
|
|
6046
6090
|
var numberOfGlobals = numberOfGlobalsu32.value;
|
|
6047
6091
|
eatBytes(numberOfGlobalsu32.nextIndex);
|
|
6048
|
-
var _metadata8 = t.sectionMetadata("global", startOffset, sectionSizeInBytesNode, function() {
|
|
6092
|
+
var _metadata8 = t.sectionMetadata("global", startOffset, sectionSizeInBytesNode, (function() {
|
|
6049
6093
|
var endLoc = getPosition();
|
|
6050
6094
|
return t.withLoc(t.numberLiteralFromRaw(numberOfGlobals), endLoc, _startLoc20);
|
|
6051
|
-
}());
|
|
6095
|
+
})());
|
|
6052
6096
|
var _nodes8 = parseGlobalSection(numberOfGlobals);
|
|
6053
6097
|
return {
|
|
6054
6098
|
nodes: _nodes8,
|
|
@@ -6064,10 +6108,10 @@ var require_decoder2 = __commonJS({
|
|
|
6064
6108
|
var _numberOfElementsu = readU32();
|
|
6065
6109
|
var _numberOfElements = _numberOfElementsu.value;
|
|
6066
6110
|
eatBytes(_numberOfElementsu.nextIndex);
|
|
6067
|
-
var _metadata9 = t.sectionMetadata("memory", startOffset, sectionSizeInBytesNode, function() {
|
|
6111
|
+
var _metadata9 = t.sectionMetadata("memory", startOffset, sectionSizeInBytesNode, (function() {
|
|
6068
6112
|
var endLoc = getPosition();
|
|
6069
6113
|
return t.withLoc(t.numberLiteralFromRaw(_numberOfElements), endLoc, _startLoc21);
|
|
6070
|
-
}());
|
|
6114
|
+
})());
|
|
6071
6115
|
var _nodes9 = parseMemorySection(_numberOfElements);
|
|
6072
6116
|
return {
|
|
6073
6117
|
nodes: _nodes9,
|
|
@@ -6084,10 +6128,10 @@ var require_decoder2 = __commonJS({
|
|
|
6084
6128
|
var _numberOfElementsu2 = readU32();
|
|
6085
6129
|
var _numberOfElements2 = _numberOfElementsu2.value;
|
|
6086
6130
|
eatBytes(_numberOfElementsu2.nextIndex);
|
|
6087
|
-
_metadata10.vectorOfSize = function() {
|
|
6131
|
+
_metadata10.vectorOfSize = (function() {
|
|
6088
6132
|
var endLoc = getPosition();
|
|
6089
6133
|
return t.withLoc(t.numberLiteralFromRaw(_numberOfElements2), endLoc, _startLoc22);
|
|
6090
|
-
}();
|
|
6134
|
+
})();
|
|
6091
6135
|
if (opts.ignoreDataSection === true) {
|
|
6092
6136
|
var _remainingBytes = sectionSizeInBytes - _numberOfElementsu2.nextIndex;
|
|
6093
6137
|
eatBytes(_remainingBytes);
|
|
@@ -6157,6 +6201,24 @@ var require_decoder2 = __commonJS({
|
|
|
6157
6201
|
};
|
|
6158
6202
|
}
|
|
6159
6203
|
}
|
|
6204
|
+
function parseBlockType() {
|
|
6205
|
+
var blocktypeByte = readByte();
|
|
6206
|
+
var blocktype = _helperWasmBytecode["default"].blockTypes[blocktypeByte];
|
|
6207
|
+
if (typeof blocktype !== "undefined") {
|
|
6208
|
+
eatBytes(1);
|
|
6209
|
+
dump([blocktypeByte], "blocktype");
|
|
6210
|
+
return blocktype;
|
|
6211
|
+
} else {
|
|
6212
|
+
var u32 = readU32();
|
|
6213
|
+
eatBytes(u32.nextIndex);
|
|
6214
|
+
var signature = state.typesInModule[u32.value];
|
|
6215
|
+
console.log({
|
|
6216
|
+
signature
|
|
6217
|
+
});
|
|
6218
|
+
dump([u32.value], "typeidx");
|
|
6219
|
+
return u32.value;
|
|
6220
|
+
}
|
|
6221
|
+
}
|
|
6160
6222
|
parseModuleHeader();
|
|
6161
6223
|
parseVersion();
|
|
6162
6224
|
var moduleFields = [];
|
|
@@ -6226,10 +6288,8 @@ var require_decoder2 = __commonJS({
|
|
|
6226
6288
|
}
|
|
6227
6289
|
}
|
|
6228
6290
|
});
|
|
6229
|
-
|
|
6230
|
-
// node_modules/.pnpm/@webassemblyjs+wasm-parser@1.12.1/node_modules/@webassemblyjs/wasm-parser/lib/index.js
|
|
6231
6291
|
var require_lib9 = __commonJS({
|
|
6232
|
-
"node_modules/.pnpm/@webassemblyjs+wasm-parser@1.
|
|
6292
|
+
"node_modules/.pnpm/@webassemblyjs+wasm-parser@1.14.1/node_modules/@webassemblyjs/wasm-parser/lib/index.js"(exports) {
|
|
6233
6293
|
function _typeof(obj) {
|
|
6234
6294
|
"@babel/helpers - typeof";
|
|
6235
6295
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
@@ -6250,8 +6310,7 @@ var require_lib9 = __commonJS({
|
|
|
6250
6310
|
var decoder = _interopRequireWildcard(require_decoder2());
|
|
6251
6311
|
var t = _interopRequireWildcard(require_lib7());
|
|
6252
6312
|
function _getRequireWildcardCache(nodeInterop) {
|
|
6253
|
-
if (typeof WeakMap !== "function")
|
|
6254
|
-
return null;
|
|
6313
|
+
if (typeof WeakMap !== "function") return null;
|
|
6255
6314
|
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
|
|
6256
6315
|
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
|
6257
6316
|
return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
|
|
@@ -6259,7 +6318,7 @@ var require_lib9 = __commonJS({
|
|
|
6259
6318
|
})(nodeInterop);
|
|
6260
6319
|
}
|
|
6261
6320
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
6262
|
-
if (
|
|
6321
|
+
if (obj && obj.__esModule) {
|
|
6263
6322
|
return obj;
|
|
6264
6323
|
}
|
|
6265
6324
|
if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
|
|
@@ -6308,7 +6367,7 @@ var require_lib9 = __commonJS({
|
|
|
6308
6367
|
return;
|
|
6309
6368
|
}
|
|
6310
6369
|
t.traverse(ast, {
|
|
6311
|
-
Func: function(_Func) {
|
|
6370
|
+
Func: (function(_Func) {
|
|
6312
6371
|
function Func(_x) {
|
|
6313
6372
|
return _Func.apply(this, arguments);
|
|
6314
6373
|
}
|
|
@@ -6316,7 +6375,7 @@ var require_lib9 = __commonJS({
|
|
|
6316
6375
|
return _Func.toString();
|
|
6317
6376
|
};
|
|
6318
6377
|
return Func;
|
|
6319
|
-
}(function(_ref2) {
|
|
6378
|
+
})(function(_ref2) {
|
|
6320
6379
|
var node = _ref2.node;
|
|
6321
6380
|
var nodeName = node.name;
|
|
6322
6381
|
var indexBasedFunctionName = nodeName.value;
|
|
@@ -6332,7 +6391,7 @@ var require_lib9 = __commonJS({
|
|
|
6332
6391
|
}
|
|
6333
6392
|
}),
|
|
6334
6393
|
// Also update the reference in the export
|
|
6335
|
-
ModuleExport: function(_ModuleExport) {
|
|
6394
|
+
ModuleExport: (function(_ModuleExport) {
|
|
6336
6395
|
function ModuleExport(_x2) {
|
|
6337
6396
|
return _ModuleExport.apply(this, arguments);
|
|
6338
6397
|
}
|
|
@@ -6340,7 +6399,7 @@ var require_lib9 = __commonJS({
|
|
|
6340
6399
|
return _ModuleExport.toString();
|
|
6341
6400
|
};
|
|
6342
6401
|
return ModuleExport;
|
|
6343
|
-
}(function(_ref3) {
|
|
6402
|
+
})(function(_ref3) {
|
|
6344
6403
|
var node = _ref3.node;
|
|
6345
6404
|
if (node.descr.exportType === "Func") {
|
|
6346
6405
|
var nodeName = node.descr.id;
|
|
@@ -6353,7 +6412,7 @@ var require_lib9 = __commonJS({
|
|
|
6353
6412
|
}
|
|
6354
6413
|
}
|
|
6355
6414
|
}),
|
|
6356
|
-
ModuleImport: function(_ModuleImport) {
|
|
6415
|
+
ModuleImport: (function(_ModuleImport) {
|
|
6357
6416
|
function ModuleImport(_x3) {
|
|
6358
6417
|
return _ModuleImport.apply(this, arguments);
|
|
6359
6418
|
}
|
|
@@ -6361,7 +6420,7 @@ var require_lib9 = __commonJS({
|
|
|
6361
6420
|
return _ModuleImport.toString();
|
|
6362
6421
|
};
|
|
6363
6422
|
return ModuleImport;
|
|
6364
|
-
}(function(_ref4) {
|
|
6423
|
+
})(function(_ref4) {
|
|
6365
6424
|
var node = _ref4.node;
|
|
6366
6425
|
if (node.descr.type === "FuncImportDescr") {
|
|
6367
6426
|
var indexBasedFunctionName = node.descr.id;
|
|
@@ -6374,7 +6433,7 @@ var require_lib9 = __commonJS({
|
|
|
6374
6433
|
}
|
|
6375
6434
|
}
|
|
6376
6435
|
}),
|
|
6377
|
-
CallInstruction: function(_CallInstruction) {
|
|
6436
|
+
CallInstruction: (function(_CallInstruction) {
|
|
6378
6437
|
function CallInstruction(_x4) {
|
|
6379
6438
|
return _CallInstruction.apply(this, arguments);
|
|
6380
6439
|
}
|
|
@@ -6382,7 +6441,7 @@ var require_lib9 = __commonJS({
|
|
|
6382
6441
|
return _CallInstruction.toString();
|
|
6383
6442
|
};
|
|
6384
6443
|
return CallInstruction;
|
|
6385
|
-
}(function(nodePath) {
|
|
6444
|
+
})(function(nodePath) {
|
|
6386
6445
|
var node = nodePath.node;
|
|
6387
6446
|
var index = node.index.value;
|
|
6388
6447
|
var functionName = functionNames.find(function(f) {
|
|
@@ -6413,7 +6472,7 @@ var require_lib9 = __commonJS({
|
|
|
6413
6472
|
return;
|
|
6414
6473
|
}
|
|
6415
6474
|
t.traverse(ast, {
|
|
6416
|
-
Func: function(_Func2) {
|
|
6475
|
+
Func: (function(_Func2) {
|
|
6417
6476
|
function Func(_x5) {
|
|
6418
6477
|
return _Func2.apply(this, arguments);
|
|
6419
6478
|
}
|
|
@@ -6421,7 +6480,7 @@ var require_lib9 = __commonJS({
|
|
|
6421
6480
|
return _Func2.toString();
|
|
6422
6481
|
};
|
|
6423
6482
|
return Func;
|
|
6424
|
-
}(function(_ref6) {
|
|
6483
|
+
})(function(_ref6) {
|
|
6425
6484
|
var node = _ref6.node;
|
|
6426
6485
|
var signature = node.signature;
|
|
6427
6486
|
if (signature.type !== "Signature") {
|
|
@@ -6443,7 +6502,7 @@ var require_lib9 = __commonJS({
|
|
|
6443
6502
|
}
|
|
6444
6503
|
function restoreModuleName(ast) {
|
|
6445
6504
|
t.traverse(ast, {
|
|
6446
|
-
ModuleNameMetadata: function(_ModuleNameMetadata) {
|
|
6505
|
+
ModuleNameMetadata: (function(_ModuleNameMetadata) {
|
|
6447
6506
|
function ModuleNameMetadata(_x6) {
|
|
6448
6507
|
return _ModuleNameMetadata.apply(this, arguments);
|
|
6449
6508
|
}
|
|
@@ -6451,9 +6510,9 @@ var require_lib9 = __commonJS({
|
|
|
6451
6510
|
return _ModuleNameMetadata.toString();
|
|
6452
6511
|
};
|
|
6453
6512
|
return ModuleNameMetadata;
|
|
6454
|
-
}(function(moduleNameMetadataPath) {
|
|
6513
|
+
})(function(moduleNameMetadataPath) {
|
|
6455
6514
|
t.traverse(ast, {
|
|
6456
|
-
Module: function(_Module) {
|
|
6515
|
+
Module: (function(_Module) {
|
|
6457
6516
|
function Module(_x7) {
|
|
6458
6517
|
return _Module.apply(this, arguments);
|
|
6459
6518
|
}
|
|
@@ -6461,7 +6520,7 @@ var require_lib9 = __commonJS({
|
|
|
6461
6520
|
return _Module.toString();
|
|
6462
6521
|
};
|
|
6463
6522
|
return Module;
|
|
6464
|
-
}(function(_ref7) {
|
|
6523
|
+
})(function(_ref7) {
|
|
6465
6524
|
var node = _ref7.node;
|
|
6466
6525
|
var name = moduleNameMetadataPath.node.value;
|
|
6467
6526
|
if (name === "") {
|
|
@@ -6485,9 +6544,7 @@ var require_lib9 = __commonJS({
|
|
|
6485
6544
|
}
|
|
6486
6545
|
}
|
|
6487
6546
|
});
|
|
6488
|
-
|
|
6489
|
-
// lib/wasm-parser.in.mjs
|
|
6490
|
-
var import_wasm_parser = __toESM(require_lib9(), 1);
|
|
6547
|
+
var import_wasm_parser = __toESM(require_lib9());
|
|
6491
6548
|
var export_decode = import_wasm_parser.decode;
|
|
6492
6549
|
|
|
6493
6550
|
function parseWasm(source, opts = {}) {
|