« Bugzilla Issues Index

#60 — Tests S15.10.2.12_A1_T1 & S15.10.2.12_A2_T1 are incorrect wrt BOM handling.

Character class \s should match BOM (\ufeff).

The \s character class in regular expressions should match the BOM marker, however the test S15.10.2.12_A1_T1.js generates the error:
"#63: Error matching character class \s between character fc00 and ffff"

S15.10.2.12_A2_T1.js (testing \S) contains a mirroring bug.

From the spec, section CharacterClassEscape contains:

The production CharacterClassEscape :: s evaluates by returning the set of characters containing the
characters that are on the right-hand side of the WhiteSpace (7.2) or LineTerminator (7.3) productions.

Table 2 in section 7.2 of the ECMAScript 5 spec contains:
\uFEFF Byte Order Mark <BOM>

(I believe this is a change between ES3 & ES5 - the sputnik test was correct with respect to ES3, but the definition of WhiteSpace changed).

Great spot! Disabled these two test cases on the live website about half an hour ago.

Added the following to the 'i63' for-loops:
if (j===65279) { continue;} //Ignore BOM

and extended the test files to include explicit BOM testing:
var i64 = String.fromCharCode(65279);
if (i64.replace(/\s/g, "") !== "") {
$ERROR("#64: Error matching character class \s for BOM (feff)");