From 04eac3e7c5811bda803fb76d2a89d8571f8004cd Mon Sep 17 00:00:00 2001 From: Alex McLean Date: Sun, 22 Dec 2024 20:04:45 +0000 Subject: [PATCH] Fix regression for d1, p1, p(n) (#1227) * fix for `d1` and `.p(1)` --- packages/core/repl.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/repl.mjs b/packages/core/repl.mjs index 560c9d33..eff0a16c 100644 --- a/packages/core/repl.mjs +++ b/packages/core/repl.mjs @@ -92,7 +92,7 @@ export function repl({ // set pattern methods that use this repl via closure const injectPatternMethods = () => { Pattern.prototype.p = function (id) { - if (id.startsWith('_') || id.endsWith('_')) { + if (typeof id === 'string' && (id.startsWith('_') || id.endsWith('_'))) { // allows muting a pattern x with x_ or _x return silence; }