From 62f6e202b0770aedcf32df916ad6ad56f2187038 Mon Sep 17 00:00:00 2001 From: Dustin Swan Date: Wed, 11 Feb 2026 23:03:23 -0700 Subject: [PATCH] no longer random identifiers for matches --- src/compiler.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler.ts b/src/compiler.ts index 4893254..47e09b4 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -1,6 +1,8 @@ import type { AST, Pattern, Definition } from './ast'; import { _rt, store } from './runtime-js'; +let matchCounter = 0; + export const definitions: Map = new Map(); export const dependencies: Map> = new Map(); export const dependents: Map> = new Map(); @@ -135,7 +137,7 @@ function sanitizeName(name: string): string { function compileMatch(ast: AST & { kind: 'match'}, useStore = true, bound = new Set()): string { const expr = compile(ast.expr, useStore, bound); - const tmpVar = `_m${Math.floor(Math.random() * 10000)}`; + const tmpVar = `_m${matchCounter++}`; let code = `((${tmpVar}) => { `;