From a32e9f6ee59c0818d3856ec8566161f68ff400d7 Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Sat, 18 Mar 2023 22:43:19 +0100 Subject: [PATCH] readline: fix unit tests --- lib/internal/readline/utils.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/internal/readline/utils.js b/lib/internal/readline/utils.js index 68ad2eae9dbdde..124a5382a0ddae 100644 --- a/lib/internal/readline/utils.js +++ b/lib/internal/readline/utils.js @@ -195,11 +195,11 @@ function* emitKeys(stream) { const cmd = StringPrototypeSlice(s, cmdStart); let match; - if ((match = RegExpPrototypeExec(/^(?:(\d\d?)(?:;(\d))?[~^$]|(\d{3}~))$/, cmd))) { - if (match[3]) { - code += match[3]; + if ((match = RegExpPrototypeExec(/^(?:(\d\d?)(?:;(\d))?([~^$])|(\d{3}~))$/, cmd))) { + if (match[4]) { + code += match[4]; } else { - code += match[1]; + code += match[1] + match[3]; modifier = (match[2] || 1) - 1; } } else if (