brsh 3.10.1 → 3.10.2
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/CHANGELOG.md +7 -0
- package/dist/shell.es.js +46 -13
- package/dist/shell.es.js.map +1 -1
- package/dist/shell.min.js +2 -2
- package/dist/shell.min.js.map +1 -1
- package/dist/wbt.es.js +20 -8
- package/dist/wbt.es.js.map +1 -1
- package/dist/wbt.min.js +1 -1
- package/dist/wbt.min.js.map +1 -1
- package/index.js +43 -9
- package/lib/ScriptCommand.js +19 -7
- package/package.json +1 -1
- package/test/scripts.test.js +48 -0
- package/test/shell.test.js +60 -0
package/dist/wbt.es.js
CHANGED
|
@@ -1750,16 +1750,28 @@ var A, j, M, N, P, F, I, L, ee, R, z = e((() => {
|
|
|
1750
1750
|
return t;
|
|
1751
1751
|
}
|
|
1752
1752
|
run() {
|
|
1753
|
-
let e =
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1753
|
+
let e = parseInt(r.sandbox.context.getVar("#") || "0", 10) || 0, t = Math.max(e, this.arguments.length), i = [];
|
|
1754
|
+
for (let e = 1; e <= t; e++) {
|
|
1755
|
+
let t = String(e);
|
|
1756
|
+
i.push({
|
|
1757
|
+
key: t,
|
|
1758
|
+
prev: r.sandbox.context.getVar(t)
|
|
1759
|
+
}), e <= this.arguments.length ? r.sandbox.context.setVar(t, this.arguments[e - 1]) : r.sandbox.context.unsetVar(t);
|
|
1760
|
+
}
|
|
1761
|
+
for (let e of [
|
|
1762
|
+
"#",
|
|
1763
|
+
"@",
|
|
1764
|
+
"*"
|
|
1765
|
+
]) i.push({
|
|
1766
|
+
key: e,
|
|
1767
|
+
prev: r.sandbox.context.getVar(e)
|
|
1768
|
+
});
|
|
1769
|
+
r.sandbox.context.setVar("#", String(this.arguments.length)), r.sandbox.context.setVar("@", this.arguments.join(" ")), r.sandbox.context.setVar("*", this.arguments.join(" "));
|
|
1770
|
+
let a = () => i.forEach(({ key: e, prev: t }) => t ? r.sandbox.context.setVar(e, t) : r.sandbox.context.unsetVar(e));
|
|
1759
1771
|
return r._executeFunctionBody(n).then(() => {
|
|
1760
|
-
|
|
1772
|
+
a();
|
|
1761
1773
|
}).catch((e) => {
|
|
1762
|
-
if (
|
|
1774
|
+
if (a(), e && e.__type === "return") {
|
|
1763
1775
|
this.exitCode = e.code;
|
|
1764
1776
|
return;
|
|
1765
1777
|
}
|