diff --git a/test/annexB/built-ins/RegExp/RegExp-invalid-control-escape-character-class.js b/test/annexB/built-ins/RegExp/RegExp-invalid-control-escape-character-class.js index 9c292da323..c7a006270c 100644 --- a/test/annexB/built-ins/RegExp/RegExp-invalid-control-escape-character-class.js +++ b/test/annexB/built-ins/RegExp/RegExp-invalid-control-escape-character-class.js @@ -34,21 +34,21 @@ for (let letter of invalidControls()) { var str = String.fromCharCode(char % 32); var arr = re.exec(str); if (str !== letter && arr !== null) { - $ERROR(`Character ${letter} unreasonably wrapped around as a control character`); + throw new Test262Error(`Character ${letter} unreasonably wrapped around as a control character`); } arr = re.exec(letter); if (arr === null) { - $ERROR(`Character ${letter} missing from character class ${source}`); + throw new Test262Error(`Character ${letter} missing from character class ${source}`); } } arr = re.exec("\\") if (arr === null) { - $ERROR(`Character \\ missing from character class ${source}`); + throw new Test262Error(`Character \\ missing from character class ${source}`); } arr = re.exec("c") if (arr === null) { - $ERROR(`Character c missing from character class ${source}`); + throw new Test262Error(`Character c missing from character class ${source}`); } }