Skip to content

Commit 107c9be

Browse files
authored
fix: Fix for ReferenceError: pattern is not defined (#506)
1 parent e3f4bdd commit 107c9be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/precompile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function precompile(source, filename = "<input>") {
3434
} catch {
3535
// swallow regex parse errors here to instead throw them at the engine level
3636
// this then also avoids regex parser bugs being thrown unnecessarily
37-
transpiledPattern = pattern;
37+
transpiledPattern = node.regex.pattern;
3838
}
3939
const transpiledRegex = `/${transpiledPattern}/${node.regex.flags}`;
4040
precompileCalls.push(`precompile(${transpiledRegex});`);

0 commit comments

Comments
 (0)