From 127ecb95223ce995c09c76907666405755aa83dc Mon Sep 17 00:00:00 2001 From: Florian Scholz Date: Thu, 7 Nov 2024 14:47:13 +0100 Subject: [PATCH 1/2] Add RegExp.escape --- features/draft/spec/tc39-regex-escaping.yml | 6 ------ features/regexp-escape.yml | 5 +++++ .../tc39-regex-escaping.yml.dist => regexp-escape.yml.dist} | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) delete mode 100644 features/draft/spec/tc39-regex-escaping.yml create mode 100644 features/regexp-escape.yml rename features/{draft/spec/tc39-regex-escaping.yml.dist => regexp-escape.yml.dist} (79%) diff --git a/features/draft/spec/tc39-regex-escaping.yml b/features/draft/spec/tc39-regex-escaping.yml deleted file mode 100644 index e1b7aac353a..00000000000 --- a/features/draft/spec/tc39-regex-escaping.yml +++ /dev/null @@ -1,6 +0,0 @@ -draft_date: 2024-11-06 -name: RegExp.escape -description: TODO -spec: https://tc39.es/proposal-regex-escaping/ -compat_features: - - javascript.builtins.RegExp.escape diff --git a/features/regexp-escape.yml b/features/regexp-escape.yml new file mode 100644 index 00000000000..0e53835abce --- /dev/null +++ b/features/regexp-escape.yml @@ -0,0 +1,5 @@ +name: RegExp.escape +description: The `RegExp.escape()` method replaces characters that are potentially special characters in a regular expression with equivalent escape sequences. +spec: https://tc39.es/proposal-regex-escaping/ +compat_features: + - javascript.builtins.RegExp.escape diff --git a/features/draft/spec/tc39-regex-escaping.yml.dist b/features/regexp-escape.yml.dist similarity index 79% rename from features/draft/spec/tc39-regex-escaping.yml.dist rename to features/regexp-escape.yml.dist index 0a8fc125be5..2c1de3e6c6a 100644 --- a/features/draft/spec/tc39-regex-escaping.yml.dist +++ b/features/regexp-escape.yml.dist @@ -1,4 +1,4 @@ -# Generated from: tc39-regex-escaping.yml +# Generated from: regexp-escape.yml # Do not edit this file by hand. Edit the source file instead! status: From dd422ddb9007611f900638b6bb9f6ed5820f6187 Mon Sep 17 00:00:00 2001 From: Florian Scholz Date: Mon, 11 Nov 2024 13:31:06 +0100 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Daniel D. Beck --- features/regexp-escape.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/regexp-escape.yml b/features/regexp-escape.yml index 0e53835abce..3b01b9ed2a0 100644 --- a/features/regexp-escape.yml +++ b/features/regexp-escape.yml @@ -1,5 +1,5 @@ -name: RegExp.escape -description: The `RegExp.escape()` method replaces characters that are potentially special characters in a regular expression with equivalent escape sequences. +name: RegExp.escape() +description: The `RegExp.escape()` static method takes a string and replaces any characters that are potentially special characters of a regular expression with equivalent escape sequences. For example, `RegExp.escape("[abc]")` returns `"\\[abc\\]"`. spec: https://tc39.es/proposal-regex-escaping/ compat_features: - javascript.builtins.RegExp.escape