fix REPLACE_GETVAR nesting issues

This commit is contained in:
LenAnderson
2024-07-04 11:48:31 -04:00
parent 32ec6aac1c
commit afb849cfb6

View File

@ -645,6 +645,7 @@ export class SlashCommandParser {
closure.abortController = this.abortController; closure.abortController = this.abortController;
closure.debugController = this.debugController; closure.debugController = this.debugController;
this.scope = closure.scope; this.scope = closure.scope;
const oldClosure = this.closure;
this.closure = closure; this.closure = closure;
this.discardWhitespace(); this.discardWhitespace();
while (this.testNamedArgument()) { while (this.testNamedArgument()) {
@ -698,6 +699,7 @@ export class SlashCommandParser {
} }
closureIndexEntry.end = this.index - 1; closureIndexEntry.end = this.index - 1;
this.scope = closure.scope.parent; this.scope = closure.scope.parent;
this.closure = oldClosure ?? closure;
return closure; return closure;
} }