Skip to content

Commit

Permalink
Fix regression for d1, p1, p(n) (#1227)
Browse files Browse the repository at this point in the history
* fix for `d1` and `.p(1)`
  • Loading branch information
yaxu authored Dec 22, 2024
1 parent 0531369 commit 04eac3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/repl.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 04eac3e

Please sign in to comment.