diff --git a/packages/core/repl.mjs b/packages/core/repl.mjs index 560c9d330..eff0a16cb 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; }