We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d43a5b8 commit 8bb17e6Copy full SHA for 8bb17e6
src/context/script-let.ts
@@ -835,12 +835,15 @@ export class ScriptLetContext {
835
// If we replace the `scope.block` at this time,
836
// the scope restore calculation will not work, so we will replace the `scope.block` later.
837
postprocessList.push(() => {
838
- const beforeBlock = scope.block
+ const beforeBlock = scope.block;
839
scope.block = node;
840
841
- for (const variable of [...scope.variables, ...scope.upper?.variables ?? []]) {
+ for (const variable of [
842
+ ...scope.variables,
843
+ ...(scope.upper?.variables ?? []),
844
+ ]) {
845
for (const def of variable.defs) {
- if(def.node === beforeBlock) {
846
+ if (def.node === beforeBlock) {
847
def.node = node;
848
}
849
0 commit comments