@danielx/civet 0.5.87 → 0.5.88
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.js +8 -5
- package/dist/main.js +8 -5
- package/dist/main.mjs +8 -5
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -175,10 +175,11 @@ var Civet = (() => {
|
|
|
175
175
|
}
|
|
176
176
|
const block = outer.parent;
|
|
177
177
|
const { expressions } = block;
|
|
178
|
-
const index = expressions.
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
178
|
+
const index = expressions.findIndex(([, s]) => outer === s);
|
|
179
|
+
if (index < 0)
|
|
180
|
+
throw new Error("Couldn't find expression in block for hoistable declaration.");
|
|
181
|
+
const indent = expressions[index][0];
|
|
182
|
+
hoistDec[0][0] = indent;
|
|
182
183
|
expressions.splice(index, 0, hoistDec);
|
|
183
184
|
node.hoistDec = null;
|
|
184
185
|
});
|
|
@@ -11155,7 +11156,7 @@ ${input.slice(result.pos)}
|
|
|
11155
11156
|
const initCondition = {
|
|
11156
11157
|
type: "AssignmentExpression",
|
|
11157
11158
|
children: [ref, " ", initializer],
|
|
11158
|
-
hoistDec: [["", ["let ", ref], "
|
|
11159
|
+
hoistDec: [["", ["let ", ref], ";"]],
|
|
11159
11160
|
blockPrefix: [["", [binding, "= ", ref], ";\n"]]
|
|
11160
11161
|
};
|
|
11161
11162
|
return initCondition;
|
|
@@ -21400,6 +21401,8 @@ ${input.slice(result.pos)}
|
|
|
21400
21401
|
exp.blocks.forEach((block) => insertPush(block, ref));
|
|
21401
21402
|
return;
|
|
21402
21403
|
}
|
|
21404
|
+
if (node[node.length - 1]?.type === "SemicolonDelimiter")
|
|
21405
|
+
return;
|
|
21403
21406
|
node.splice(1, 0, ref, ".push(");
|
|
21404
21407
|
node.push(")");
|
|
21405
21408
|
}
|
package/dist/main.js
CHANGED
|
@@ -174,10 +174,11 @@ var require_lib = __commonJS({
|
|
|
174
174
|
}
|
|
175
175
|
const block = outer.parent;
|
|
176
176
|
const { expressions } = block;
|
|
177
|
-
const index = expressions.
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
177
|
+
const index = expressions.findIndex(([, s]) => outer === s);
|
|
178
|
+
if (index < 0)
|
|
179
|
+
throw new Error("Couldn't find expression in block for hoistable declaration.");
|
|
180
|
+
const indent = expressions[index][0];
|
|
181
|
+
hoistDec[0][0] = indent;
|
|
181
182
|
expressions.splice(index, 0, hoistDec);
|
|
182
183
|
node.hoistDec = null;
|
|
183
184
|
});
|
|
@@ -11154,7 +11155,7 @@ ${input.slice(result.pos)}
|
|
|
11154
11155
|
const initCondition = {
|
|
11155
11156
|
type: "AssignmentExpression",
|
|
11156
11157
|
children: [ref, " ", initializer],
|
|
11157
|
-
hoistDec: [["", ["let ", ref], "
|
|
11158
|
+
hoistDec: [["", ["let ", ref], ";"]],
|
|
11158
11159
|
blockPrefix: [["", [binding, "= ", ref], ";\n"]]
|
|
11159
11160
|
};
|
|
11160
11161
|
return initCondition;
|
|
@@ -21399,6 +21400,8 @@ ${input.slice(result.pos)}
|
|
|
21399
21400
|
exp.blocks.forEach((block) => insertPush(block, ref));
|
|
21400
21401
|
return;
|
|
21401
21402
|
}
|
|
21403
|
+
if (node[node.length - 1]?.type === "SemicolonDelimiter")
|
|
21404
|
+
return;
|
|
21402
21405
|
node.splice(1, 0, ref, ".push(");
|
|
21403
21406
|
node.push(")");
|
|
21404
21407
|
}
|
package/dist/main.mjs
CHANGED
|
@@ -172,10 +172,11 @@ var require_lib = __commonJS({
|
|
|
172
172
|
}
|
|
173
173
|
const block = outer.parent;
|
|
174
174
|
const { expressions } = block;
|
|
175
|
-
const index = expressions.
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
175
|
+
const index = expressions.findIndex(([, s]) => outer === s);
|
|
176
|
+
if (index < 0)
|
|
177
|
+
throw new Error("Couldn't find expression in block for hoistable declaration.");
|
|
178
|
+
const indent = expressions[index][0];
|
|
179
|
+
hoistDec[0][0] = indent;
|
|
179
180
|
expressions.splice(index, 0, hoistDec);
|
|
180
181
|
node.hoistDec = null;
|
|
181
182
|
});
|
|
@@ -11152,7 +11153,7 @@ ${input.slice(result.pos)}
|
|
|
11152
11153
|
const initCondition = {
|
|
11153
11154
|
type: "AssignmentExpression",
|
|
11154
11155
|
children: [ref, " ", initializer],
|
|
11155
|
-
hoistDec: [["", ["let ", ref], "
|
|
11156
|
+
hoistDec: [["", ["let ", ref], ";"]],
|
|
11156
11157
|
blockPrefix: [["", [binding, "= ", ref], ";\n"]]
|
|
11157
11158
|
};
|
|
11158
11159
|
return initCondition;
|
|
@@ -21397,6 +21398,8 @@ ${input.slice(result.pos)}
|
|
|
21397
21398
|
exp.blocks.forEach((block) => insertPush(block, ref));
|
|
21398
21399
|
return;
|
|
21399
21400
|
}
|
|
21401
|
+
if (node[node.length - 1]?.type === "SemicolonDelimiter")
|
|
21402
|
+
return;
|
|
21400
21403
|
node.splice(1, 0, ref, ".push(");
|
|
21401
21404
|
node.push(")");
|
|
21402
21405
|
}
|