restore closure vars

This commit is contained in:
LenAnderson 2024-07-20 14:03:10 -04:00
parent 427f9b9ae4
commit c06f422e76
1 changed files with 4 additions and 4 deletions

View File

@ -803,7 +803,7 @@ function letCallback(args, value) {
const key = args.key;
if (typeof key != 'string') throw new Error('Key must be a string');
if (args._hasUnnamedArgument) {
const val = value.join(' ');
const val = typeof value[0] == 'string' ? value.join(' ') : value[0];
args._scope.letVariable(key, val);
return val;
} else {
@ -814,7 +814,7 @@ function letCallback(args, value) {
const key = value.shift();
if (typeof key != 'string') throw new Error('Key must be a string');
if (value.length > 0) {
const val = value.join(' ');
const val = typeof value[0] == 'string' ? value.join(' ') : value[0];
args._scope.letVariable(key, val);
return val;
} else {
@ -835,7 +835,7 @@ function varCallback(args, value) {
const key = args.key;
if (typeof key != 'string') throw new Error('Key must be a string');
if (args._hasUnnamedArgument) {
const val = value.join(' ');
const val = typeof value[0] == 'string' ? value.join(' ') : value[0];
args._scope.setVariable(key, val, args.index);
return val;
} else {
@ -845,7 +845,7 @@ function varCallback(args, value) {
const key = value.shift();
if (typeof key != 'string') throw new Error('Key must be a string');
if (value.length > 0) {
const val = value.join(' ');
const val = typeof value[0] == 'string' ? value.join(' ') : value[0];
args._scope.setVariable(key, val, args.index);
return val;
} else {