fix(developer): fix for incorrectly-stateful regex

- take out the /g flag for regex used with .exec

For #10734
This commit is contained in:
Steven R. Loomis 2024-02-15 15:47:41 -06:00
parent 5edb70f07a
commit 7cd2e2d4e0
2 changed files with 1 additions and 2 deletions

View file

@ -400,7 +400,7 @@ export class VariableParser {
/**
* Pattern for matching a capture set reference `($[set])`
*/
public static readonly CAPTURE_SET_REFERENCE = /\(\$\[([0-9A-Za-z_]{1,32})\]\)/g;
public static readonly CAPTURE_SET_REFERENCE = /\(\$\[([0-9A-Za-z_]{1,32})\]\)/;
/**
* `$[1:variable]`

View file

@ -126,7 +126,6 @@ export abstract class TransformCompiler<T extends TransformCompilerType, TranBas
let cookedFrom = transform.from;
cookedFrom = sections.vars.substituteStrings(cookedFrom, sections);
// TODO: handle 'map' case
const mapFrom = VariableParser.CAPTURE_SET_REFERENCE.exec(cookedFrom);
const mapTo = VariableParser.MAPPED_SET_REFERENCE.exec(transform.to || '');
if (mapFrom && mapTo) { // TODO-LDML: error cases