chore: migrate $ERROR -> throw new Test262Error in test/annexB (#3121)

This commit is contained in:
Rick Waldron 2021-07-29 14:03:18 -04:00 committed by GitHub
parent 5ab89bbb55
commit 2bb2256877
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -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}`);
}
}