@ruby/wasm-wasi 2.7.1-2025-02-04-a → 2.7.1
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/dist/browser.script.umd.js +8 -8
- package/dist/browser.umd.js +7 -7
- package/dist/index.umd.js +3 -3
- package/package.json +4 -4
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
if (m) return m.call(o);
|
|
27
27
|
if (o && typeof o.length === "number") return {
|
|
28
28
|
next: function () {
|
|
29
|
-
if (o && i >= o.length) o =
|
|
29
|
+
if (o && i >= o.length) o = void 0;
|
|
30
30
|
return { value: o && o[i++], done: !o };
|
|
31
31
|
}
|
|
32
32
|
};
|
|
@@ -771,10 +771,10 @@
|
|
|
771
771
|
wasi_snapshot_preview1: wasip1.wasiImport,
|
|
772
772
|
};
|
|
773
773
|
vm.addToImports(imports);
|
|
774
|
-
(_a = options.addToImports) === null || _a ===
|
|
774
|
+
(_a = options.addToImports) === null || _a === void 0 ? void 0 : _a.call(options, imports);
|
|
775
775
|
const instance = await WebAssembly.instantiate(module, imports);
|
|
776
776
|
await vm.setInstance(instance);
|
|
777
|
-
(_b = options.setMemory) === null || _b ===
|
|
777
|
+
(_b = options.setMemory) === null || _b === void 0 ? void 0 : _b.call(options, instance.exports.memory);
|
|
778
778
|
wasip1.initialize(instance);
|
|
779
779
|
vm.initialize(options.args);
|
|
780
780
|
return { vm, instance };
|
|
@@ -893,7 +893,7 @@
|
|
|
893
893
|
}
|
|
894
894
|
return exports;
|
|
895
895
|
};
|
|
896
|
-
this.guest = proxyExports(binding !== null && binding !==
|
|
896
|
+
this.guest = proxyExports(binding !== null && binding !== void 0 ? binding : new LegacyBinding());
|
|
897
897
|
this.transport = new JsValueTransport();
|
|
898
898
|
this.exceptionFormatter = new RbExceptionFormatter();
|
|
899
899
|
}
|
|
@@ -1562,7 +1562,7 @@
|
|
|
1562
1562
|
const DefaultRubyVM = async (rubyModule, options = {}) => {
|
|
1563
1563
|
var _a, _b;
|
|
1564
1564
|
const args = [];
|
|
1565
|
-
const env = Object.entries((_a = options.env) !== null && _a !==
|
|
1565
|
+
const env = Object.entries((_a = options.env) !== null && _a !== void 0 ? _a : {}).map(([k, v]) => `${k}=${v}`);
|
|
1566
1566
|
const fds = [
|
|
1567
1567
|
new OpenFile(new File([])),
|
|
1568
1568
|
new OpenFile(new File([])),
|
|
@@ -1570,14 +1570,14 @@
|
|
|
1570
1570
|
new PreopenDirectory("/", new Map()),
|
|
1571
1571
|
];
|
|
1572
1572
|
const wasi = new WASI(args, env, fds, { debug: false });
|
|
1573
|
-
const printer = ((_b = options.consolePrint) !== null && _b !==
|
|
1573
|
+
const printer = ((_b = options.consolePrint) !== null && _b !== void 0 ? _b : true) ? consolePrinter() : undefined;
|
|
1574
1574
|
const { vm, instance } = await RubyVM.instantiateModule({
|
|
1575
1575
|
module: rubyModule, wasip1: wasi,
|
|
1576
1576
|
addToImports: (imports) => {
|
|
1577
|
-
printer === null || printer ===
|
|
1577
|
+
printer === null || printer === void 0 ? void 0 : printer.addToImports(imports);
|
|
1578
1578
|
},
|
|
1579
1579
|
setMemory: (memory) => {
|
|
1580
|
-
printer === null || printer ===
|
|
1580
|
+
printer === null || printer === void 0 ? void 0 : printer.setMemory(memory);
|
|
1581
1581
|
}
|
|
1582
1582
|
});
|
|
1583
1583
|
return {
|
package/dist/browser.umd.js
CHANGED
|
@@ -729,10 +729,10 @@
|
|
|
729
729
|
wasi_snapshot_preview1: wasip1.wasiImport,
|
|
730
730
|
};
|
|
731
731
|
vm.addToImports(imports);
|
|
732
|
-
(_a = options.addToImports) === null || _a ===
|
|
732
|
+
(_a = options.addToImports) === null || _a === void 0 ? void 0 : _a.call(options, imports);
|
|
733
733
|
const instance = await WebAssembly.instantiate(module, imports);
|
|
734
734
|
await vm.setInstance(instance);
|
|
735
|
-
(_b = options.setMemory) === null || _b ===
|
|
735
|
+
(_b = options.setMemory) === null || _b === void 0 ? void 0 : _b.call(options, instance.exports.memory);
|
|
736
736
|
wasip1.initialize(instance);
|
|
737
737
|
vm.initialize(options.args);
|
|
738
738
|
return { vm, instance };
|
|
@@ -851,7 +851,7 @@
|
|
|
851
851
|
}
|
|
852
852
|
return exports;
|
|
853
853
|
};
|
|
854
|
-
this.guest = proxyExports(binding !== null && binding !==
|
|
854
|
+
this.guest = proxyExports(binding !== null && binding !== void 0 ? binding : new LegacyBinding());
|
|
855
855
|
this.transport = new JsValueTransport();
|
|
856
856
|
this.exceptionFormatter = new RbExceptionFormatter();
|
|
857
857
|
}
|
|
@@ -1520,7 +1520,7 @@
|
|
|
1520
1520
|
const DefaultRubyVM = async (rubyModule, options = {}) => {
|
|
1521
1521
|
var _a, _b;
|
|
1522
1522
|
const args = [];
|
|
1523
|
-
const env = Object.entries((_a = options.env) !== null && _a !==
|
|
1523
|
+
const env = Object.entries((_a = options.env) !== null && _a !== void 0 ? _a : {}).map(([k, v]) => `${k}=${v}`);
|
|
1524
1524
|
const fds = [
|
|
1525
1525
|
new OpenFile(new File([])),
|
|
1526
1526
|
new OpenFile(new File([])),
|
|
@@ -1528,14 +1528,14 @@
|
|
|
1528
1528
|
new PreopenDirectory("/", new Map()),
|
|
1529
1529
|
];
|
|
1530
1530
|
const wasi = new WASI(args, env, fds, { debug: false });
|
|
1531
|
-
const printer = ((_b = options.consolePrint) !== null && _b !==
|
|
1531
|
+
const printer = ((_b = options.consolePrint) !== null && _b !== void 0 ? _b : true) ? consolePrinter() : undefined;
|
|
1532
1532
|
const { vm, instance } = await RubyVM.instantiateModule({
|
|
1533
1533
|
module: rubyModule, wasip1: wasi,
|
|
1534
1534
|
addToImports: (imports) => {
|
|
1535
|
-
printer === null || printer ===
|
|
1535
|
+
printer === null || printer === void 0 ? void 0 : printer.addToImports(imports);
|
|
1536
1536
|
},
|
|
1537
1537
|
setMemory: (memory) => {
|
|
1538
|
-
printer === null || printer ===
|
|
1538
|
+
printer === null || printer === void 0 ? void 0 : printer.setMemory(memory);
|
|
1539
1539
|
}
|
|
1540
1540
|
});
|
|
1541
1541
|
return {
|
package/dist/index.umd.js
CHANGED
|
@@ -719,10 +719,10 @@
|
|
|
719
719
|
wasi_snapshot_preview1: wasip1.wasiImport,
|
|
720
720
|
};
|
|
721
721
|
vm.addToImports(imports);
|
|
722
|
-
(_a = options.addToImports) === null || _a ===
|
|
722
|
+
(_a = options.addToImports) === null || _a === void 0 ? void 0 : _a.call(options, imports);
|
|
723
723
|
const instance = await WebAssembly.instantiate(module, imports);
|
|
724
724
|
await vm.setInstance(instance);
|
|
725
|
-
(_b = options.setMemory) === null || _b ===
|
|
725
|
+
(_b = options.setMemory) === null || _b === void 0 ? void 0 : _b.call(options, instance.exports.memory);
|
|
726
726
|
wasip1.initialize(instance);
|
|
727
727
|
vm.initialize(options.args);
|
|
728
728
|
return { vm, instance };
|
|
@@ -841,7 +841,7 @@
|
|
|
841
841
|
}
|
|
842
842
|
return exports;
|
|
843
843
|
};
|
|
844
|
-
this.guest = proxyExports(binding !== null && binding !==
|
|
844
|
+
this.guest = proxyExports(binding !== null && binding !== void 0 ? binding : new LegacyBinding());
|
|
845
845
|
this.transport = new JsValueTransport();
|
|
846
846
|
this.exceptionFormatter = new RbExceptionFormatter();
|
|
847
847
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ruby/wasm-wasi",
|
|
3
|
-
"version": "2.7.1
|
|
3
|
+
"version": "2.7.1",
|
|
4
4
|
"description": "WebAssembly port of CRuby with WASI",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@bytecodealliance/jco": "1.8.1",
|
|
57
57
|
"@rollup/plugin-typescript": "^12.1.1",
|
|
58
|
-
"@types/node": "22.10.
|
|
58
|
+
"@types/node": "22.10.1",
|
|
59
59
|
"prettier": "^3.4.1",
|
|
60
|
-
"typescript": "^5.7.
|
|
61
|
-
"vitest": "^
|
|
60
|
+
"typescript": "^5.7.2",
|
|
61
|
+
"vitest": "^2.1.6"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@bjorn3/browser_wasi_shim": "^0.3.0",
|