Test \b escape inside CharacterClass in Unicode RegExp

This commit is contained in:
Alexey Shvayka 2020-02-11 23:54:08 +02:00 committed by Rick Waldron
parent 7117cddeca
commit 2377131fd7
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
// Copyright (C) 2020 Alexey Shvayka. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: prod-ClassEscapes
description: >
\b escape inside CharacterClass is valid in Unicode patterns (unlike \B).
info: |
ClassEscape[U] ::
b
Static Semantics: CharacterValue
ClassEscape :: b
1. Return the code point value of U+0008 (BACKSPACE).
---*/
assert(/[\b]/u.test('\b'));
assert(/[\b-A]/u.test('A'));