diff --git a/test/built-ins/JSON/parse/15.12.1.1-0-7.js b/test/built-ins/JSON/parse/15.12.1.1-0-7.js index 25e408786b..0f5e758e68 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-0-7.js +++ b/test/built-ins/JSON/parse/15.12.1.1-0-7.js @@ -9,6 +9,6 @@ description: > ---*/ assert.throws(SyntaxError, function() { - // the following should produce a syntax error - JSON.parse('\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u30001234'); + // the following should produce a syntax error + JSON.parse('\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u30001234'); }); diff --git a/test/built-ins/Number/S9.3.1_A2.js b/test/built-ins/Number/S9.3.1_A2.js index 4293afb335..e52c47e0e8 100644 --- a/test/built-ins/Number/S9.3.1_A2.js +++ b/test/built-ins/Number/S9.3.1_A2.js @@ -10,12 +10,12 @@ description: > ---*/ // CHECK#1 -if (Number("\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000") !== 0) { - $ERROR('#1.1: Number("\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000") === 0. Actual: ' + (Number("\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000"))); +if (Number("\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000") !== 0) { + $ERROR('#1.1: Number("\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000") === 0. Actual: ' + (Number("\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000"))); } else { - if (1/Number("\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000") !== Number.POSITIVE_INFINITY) { - $ERROR('#1.2: Number("\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000") === +0. Actual: -0'); - } + if (1/Number("\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000") !== Number.POSITIVE_INFINITY) { + $ERROR('#1.2: Number("\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000") === +0. Actual: -0'); + } } // CHECK#2 @@ -24,7 +24,7 @@ if (Number(" ") !== 0) { } else { if (1/Number(" ") !== Number.POSITIVE_INFINITY) { $ERROR('#2.2: Number(" ") === +0. Actual: -0'); - } + } } // CHECK#3 @@ -33,7 +33,7 @@ if (Number("\t") !== 0) { } else { if (1/Number("\t") !== Number.POSITIVE_INFINITY) { $ERROR('#3.2: Number("\\t") === +0. Actual: -0'); - } + } } // CHECK#4 @@ -42,7 +42,7 @@ if (Number("\r") !== 0) { } else { if (1/Number("\r") !== Number.POSITIVE_INFINITY) { $ERROR('#4.2: Number("\\r") === +0. Actual: -0'); - } + } } // CHECK#5 @@ -51,7 +51,7 @@ if (Number("\n") !== 0) { } else { if (1/Number("\n") !== Number.POSITIVE_INFINITY) { $ERROR('#5.2: Number("\\n") === +0. Actual: -0'); - } + } } // CHECK#6 @@ -60,7 +60,7 @@ if (Number("\f") !== 0) { } else { if (1/Number("\f") !== Number.POSITIVE_INFINITY) { $ERROR('#6.2: Number("\\f") === +0. Actual: -0'); - } + } } // CHECK#7 @@ -69,7 +69,7 @@ if (Number("\u0009") !== 0) { } else { if (1/Number("\u0009") !== Number.POSITIVE_INFINITY) { $ERROR('#7.2: Number("\\u0009") === +0. Actual: -0'); - } + } } // CHECK#8 @@ -78,7 +78,7 @@ if (Number("\u000A") !== 0) { } else { if (1/Number("\u000A") !== Number.POSITIVE_INFINITY) { $ERROR('#8.2: Number("\\u000A") === +0. Actual: -0'); - } + } } // CHECK#9 @@ -87,7 +87,7 @@ if (Number("\u000B") !== 0) { } else { if (1/Number("\u000B") !== Number.POSITIVE_INFINITY) { $ERROR('#9.1.2: Number("\\u000B") === +0. Actual: -0'); - } + } } // CHECK#10 @@ -96,7 +96,7 @@ if (Number("\u000C") !== 0) { } else { if (1/Number("\u000C") !== Number.POSITIVE_INFINITY) { $ERROR('#10.2: Number("\\u000C") === +0. Actual: -0'); - } + } } // CHECK#11 @@ -105,7 +105,7 @@ if (Number("\u000D") !== 0) { } else { if (1/Number("\u000D") !== Number.POSITIVE_INFINITY) { $ERROR('#11.2: Number("\\u000D") === +0. Actual: -0'); - } + } } // CHECK#12 @@ -114,7 +114,7 @@ if (Number("\u00A0") !== 0) { } else { if (1/Number("\u00A0") !== Number.POSITIVE_INFINITY) { $ERROR('#12.2: Number("\\u00A0") === +0. Actual: -0'); - } + } } // CHECK#13 @@ -123,7 +123,7 @@ if (Number("\u0020") !== 0) { } else { if (1/Number("\u0020") !== Number.POSITIVE_INFINITY) { $ERROR('#13.2: Number("\\u0020") === +0. Actual: -0'); - } + } } // CHECK#14 @@ -132,7 +132,7 @@ if (Number("\u2028") !== 0) { } else { if (1/Number("\u2028") !== Number.POSITIVE_INFINITY) { $ERROR('#14.2: Number("\\u2028") === +0. Actual: -0'); - } + } } // CHECK#15 @@ -141,7 +141,7 @@ if (Number("\u2029") !== 0) { } else { if (1/Number("\u2029") !== Number.POSITIVE_INFINITY) { $ERROR('#15.2: Number("\\u2029") === +0. Actual: -0'); - } + } } // CHECK#16 @@ -150,140 +150,131 @@ if (Number("\u1680") !== 0) { } else { if (1/Number("\u1680") !== Number.POSITIVE_INFINITY) { $ERROR('#16.2: Number("\\u1680") === +0. Actual: -0'); - } + } } // CHECK#17 -if (Number("\u180E") !== 0) { - $ERROR('#17.1: Number("\\u180E") === 0. Actual: ' + (Number("\u180E"))); +if (Number("\u2000") !== 0) { + $ERROR('#17.1: Number("\\u2000") === 0. Actual: ' + (Number("\u2000"))); } else { - if (1/Number("\u180E") !== Number.POSITIVE_INFINITY) { - $ERROR('#17.2: Number("\\u180E") === +0. Actual: -0'); - } + if (1/Number("\u2000") !== Number.POSITIVE_INFINITY) { + $ERROR('#17.2: Number("\\u2000") === +0. Actual: -0'); + } } // CHECK#18 -if (Number("\u2000") !== 0) { - $ERROR('#18.1: Number("\\u2000") === 0. Actual: ' + (Number("\u2000"))); +if (Number("\u2001") !== 0) { + $ERROR('#18.1: Number("\\u2001") === 0. Actual: ' + (Number("\u2001"))); } else { - if (1/Number("\u2000") !== Number.POSITIVE_INFINITY) { - $ERROR('#18.2: Number("\\u2000") === +0. Actual: -0'); - } + if (1/Number("\u2001") !== Number.POSITIVE_INFINITY) { + $ERROR('#18.2: Number("\\u2001") === +0. Actual: -0'); + } } // CHECK#19 -if (Number("\u2001") !== 0) { - $ERROR('#19.1: Number("\\u2001") === 0. Actual: ' + (Number("\u2001"))); +if (Number("\u2002") !== 0) { + $ERROR('#19.1: Number("\\u2002") === 0. Actual: ' + (Number("\u2002"))); } else { - if (1/Number("\u2001") !== Number.POSITIVE_INFINITY) { - $ERROR('#19.2: Number("\\u2001") === +0. Actual: -0'); - } + if (1/Number("\u2002") !== Number.POSITIVE_INFINITY) { + $ERROR('#19.2: Number("\\u2002") === +0. Actual: -0'); + } } // CHECK#20 -if (Number("\u2002") !== 0) { - $ERROR('#20.1: Number("\\u2002") === 0. Actual: ' + (Number("\u2002"))); +if (Number("\u2003") !== 0) { + $ERROR('#20.1: Number("\\u2003") === 0. Actual: ' + (Number("\u2003"))); } else { - if (1/Number("\u2002") !== Number.POSITIVE_INFINITY) { - $ERROR('#20.2: Number("\\u2002") === +0. Actual: -0'); - } + if (1/Number("\u2003") !== Number.POSITIVE_INFINITY) { + $ERROR('#20.2: Number("\\u2003") === +0. Actual: -0'); + } } // CHECK#21 -if (Number("\u2003") !== 0) { - $ERROR('#21.1: Number("\\u2003") === 0. Actual: ' + (Number("\u2003"))); +if (Number("\u2004") !== 0) { + $ERROR('#21.1: Number("\\u2004") === 0. Actual: ' + (Number("\u2004"))); } else { - if (1/Number("\u2003") !== Number.POSITIVE_INFINITY) { - $ERROR('#21.2: Number("\\u2003") === +0. Actual: -0'); - } + if (1/Number("\u2004") !== Number.POSITIVE_INFINITY) { + $ERROR('#21.2: Number("\\u2004") === +0. Actual: -0'); + } } // CHECK#22 -if (Number("\u2004") !== 0) { - $ERROR('#22.1: Number("\\u2004") === 0. Actual: ' + (Number("\u2004"))); +if (Number("\u2005") !== 0) { + $ERROR('#22.1: Number("\\u2005") === 0. Actual: ' + (Number("\u2005"))); } else { - if (1/Number("\u2004") !== Number.POSITIVE_INFINITY) { - $ERROR('#22.2: Number("\\u2004") === +0. Actual: -0'); - } + if (1/Number("\u2005") !== Number.POSITIVE_INFINITY) { + $ERROR('#22.2: Number("\\u2005") === +0. Actual: -0'); + } } // CHECK#23 -if (Number("\u2005") !== 0) { - $ERROR('#23.1: Number("\\u2005") === 0. Actual: ' + (Number("\u2005"))); +if (Number("\u2006") !== 0) { + $ERROR('#23.1: Number("\\u2006") === 0. Actual: ' + (Number("\u2006"))); } else { - if (1/Number("\u2005") !== Number.POSITIVE_INFINITY) { - $ERROR('#23.2: Number("\\u2005") === +0. Actual: -0'); - } + if (1/Number("\u2006") !== Number.POSITIVE_INFINITY) { + $ERROR('#23.2: Number("\\u2006") === +0. Actual: -0'); + } } // CHECK#24 -if (Number("\u2006") !== 0) { - $ERROR('#24.1: Number("\\u2006") === 0. Actual: ' + (Number("\u2006"))); +if (Number("\u2007") !== 0) { + $ERROR('#24.1: Number("\\u2007") === 0. Actual: ' + (Number("\u2007"))); } else { - if (1/Number("\u2006") !== Number.POSITIVE_INFINITY) { - $ERROR('#24.2: Number("\\u2006") === +0. Actual: -0'); - } + if (1/Number("\u2007") !== Number.POSITIVE_INFINITY) { + $ERROR('#24.2: Number("\\u2007") === +0. Actual: -0'); + } } // CHECK#25 -if (Number("\u2007") !== 0) { - $ERROR('#25.1: Number("\\u2007") === 0. Actual: ' + (Number("\u2007"))); +if (Number("\u2008") !== 0) { + $ERROR('#25.1: Number("\\u2008") === 0. Actual: ' + (Number("\u2008"))); } else { - if (1/Number("\u2007") !== Number.POSITIVE_INFINITY) { - $ERROR('#25.2: Number("\\u2007") === +0. Actual: -0'); - } + if (1/Number("\u2008") !== Number.POSITIVE_INFINITY) { + $ERROR('#25.2: Number("\\u2008") === +0. Actual: -0'); + } } // CHECK#26 -if (Number("\u2008") !== 0) { - $ERROR('#26.1: Number("\\u2008") === 0. Actual: ' + (Number("\u2008"))); +if (Number("\u2009") !== 0) { + $ERROR('#26.1: Number("\\u2009") === 0. Actual: ' + (Number("\u2009"))); } else { - if (1/Number("\u2008") !== Number.POSITIVE_INFINITY) { - $ERROR('#26.2: Number("\\u2008") === +0. Actual: -0'); - } + if (1/Number("\u2009") !== Number.POSITIVE_INFINITY) { + $ERROR('#26.2: Number("\\u2009") === +0. Actual: -0'); + } } // CHECK#27 -if (Number("\u2009") !== 0) { - $ERROR('#27.1: Number("\\u2009") === 0. Actual: ' + (Number("\u2009"))); +if (Number("\u200A") !== 0) { + $ERROR('#27.1: Number("\\u200A") === 0. Actual: ' + (Number("\u200A"))); } else { - if (1/Number("\u2009") !== Number.POSITIVE_INFINITY) { - $ERROR('#27.2: Number("\\u2009") === +0. Actual: -0'); - } + if (1/Number("\u200A") !== Number.POSITIVE_INFINITY) { + $ERROR('#27.2: Number("\\u200A") === +0. Actual: -0'); + } } // CHECK#28 -if (Number("\u200A") !== 0) { - $ERROR('#28.1: Number("\\u200A") === 0. Actual: ' + (Number("\u200A"))); +if (Number("\u202F") !== 0) { + $ERROR('#28.1: Number("\\u202F") === 0. Actual: ' + (Number("\u202F"))); } else { - if (1/Number("\u200A") !== Number.POSITIVE_INFINITY) { - $ERROR('#28.2: Number("\\u200A") === +0. Actual: -0'); - } + if (1/Number("\u202F") !== Number.POSITIVE_INFINITY) { + $ERROR('#28.2: Number("\\u202F") === +0. Actual: -0'); + } } // CHECK#29 -if (Number("\u202F") !== 0) { - $ERROR('#29.1: Number("\\u202F") === 0. Actual: ' + (Number("\u202F"))); +if (Number("\u205F") !== 0) { + $ERROR('#29.1: Number("\\u205F") === 0. Actual: ' + (Number("\u205F"))); } else { - if (1/Number("\u202F") !== Number.POSITIVE_INFINITY) { - $ERROR('#29.2: Number("\\u202F") === +0. Actual: -0'); - } + if (1/Number("\u205F") !== Number.POSITIVE_INFINITY) { + $ERROR('#29.2: Number("\\u205F") === +0. Actual: -0'); + } } // CHECK#30 -if (Number("\u205F") !== 0) { - $ERROR('#30.1: Number("\\u205F") === 0. Actual: ' + (Number("\u205F"))); -} else { - if (1/Number("\u205F") !== Number.POSITIVE_INFINITY) { - $ERROR('#30.2: Number("\\u205F") === +0. Actual: -0'); - } -} - -// CHECK#31 if (Number("\u3000") !== 0) { - $ERROR('#31.1: Number("\\u3000") === 0. Actual: ' + (Number("\u3000"))); + $ERROR('#30.1: Number("\\u3000") === 0. Actual: ' + (Number("\u3000"))); } else { if (1/Number("\u3000") !== Number.POSITIVE_INFINITY) { - $ERROR('#31.2: Number("\\u3000") === +0. Actual: -0'); - } + $ERROR('#30.2: Number("\\u3000") === +0. Actual: -0'); + } } diff --git a/test/built-ins/Number/S9.3.1_A2_U180E.js b/test/built-ins/Number/S9.3.1_A2_U180E.js new file mode 100644 index 0000000000..4ccbee6c89 --- /dev/null +++ b/test/built-ins/Number/S9.3.1_A2_U180E.js @@ -0,0 +1,33 @@ +// Copyright 2016 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: > + Ensure U+180E is not recognized as whitespace, convert to Number by explicit transformation +info: > + 7.1.3.1 ToNumber Applied to the String Type + + If the grammar cannot interpret the String as an expansion of + StringNumericLiteral, then the result of ToNumber is NaN. + + StringNumericLiteral ::: + StrWhiteSpace_opt StrNumericLiteral StrWhiteSpace_opt + StrWhiteSpace ::: + StrWhiteSpaceChar StrWhiteSpace_opt + StrWhiteSpaceChar ::: + WhiteSpace + LineTerminator + WhiteSpace :: + + + + + + + + :: + Other category “Zs” code points +---*/ + +assert.sameValue(Number('\u180E'), NaN, 'Number("\\u180E") === NaN. Actual: ' + (Number("\u180E"))); diff --git a/test/built-ins/Number/S9.3.1_A3_T1.js b/test/built-ins/Number/S9.3.1_A3_T1.js index d549a588d8..1d3abbec8c 100644 --- a/test/built-ins/Number/S9.3.1_A3_T1.js +++ b/test/built-ins/Number/S9.3.1_A3_T1.js @@ -11,21 +11,21 @@ description: static string ---*/ // CHECK#1 -if (Number("\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000") !== Number("")) { - $ERROR('#1: Number("\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000") === Number("")'); +if (Number("\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000") !== Number("")) { + $ERROR('#1: Number("\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000") === Number("")'); } // CHECK#2 -if (Number("\u0009\u000C\u0020\u00A0\u000A\u000D\u2028\u2029\u000B\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u30001234567890\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000") !== Number("1234567890")) { - $ERROR('#2: Number("\\u0009\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029\\u000B\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u30001234567890\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000") === Number("1234567890")'); +if (Number("\u0009\u000C\u0020\u00A0\u000A\u000D\u2028\u2029\u000B\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u30001234567890\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000") !== Number("1234567890")) { + $ERROR('#2: Number("\\u0009\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029\\u000B\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u30001234567890\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000") === Number("1234567890")'); } // CHECK#3 -if (!(+("\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000Infinity\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000") == Number("Infinity"))) { - $ERROR('#3: +("\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000Infinity\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000") == Number("Infinity")'); +if (!(+("\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000Infinity\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000") == Number("Infinity"))) { + $ERROR('#3: +("\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000Infinity\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000") == Number("Infinity")'); } // CHECK#4 -if (!(Number("\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000-Infinity\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000") == Number(-"Infinity"))) { - $ERROR('#4: Number("\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000-Infinity\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000") == Number("-Infinity")'); +if (!(Number("\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000-Infinity\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000") == Number(-"Infinity"))) { + $ERROR('#4: Number("\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000-Infinity\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000") == Number("-Infinity")'); } diff --git a/test/built-ins/Number/S9.3.1_A3_T1_U180E.js b/test/built-ins/Number/S9.3.1_A3_T1_U180E.js new file mode 100644 index 0000000000..12d3ed43d5 --- /dev/null +++ b/test/built-ins/Number/S9.3.1_A3_T1_U180E.js @@ -0,0 +1,43 @@ +// Copyright 2016 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: > + Ensure U+180E is not recognized as whitespace, test ToNumber with static string +info: > + 7.1.3.1 ToNumber Applied to the String Type + + If the grammar cannot interpret the String as an expansion of + StringNumericLiteral, then the result of ToNumber is NaN. + + StringNumericLiteral ::: + StrWhiteSpace_opt StrNumericLiteral StrWhiteSpace_opt + StrWhiteSpace ::: + StrWhiteSpaceChar StrWhiteSpace_opt + StrWhiteSpaceChar ::: + WhiteSpace + LineTerminator + WhiteSpace :: + + + + + + + + :: + Other category “Zs” code points +---*/ + +// CHECK#1 +assert.sameValue(Number('\u180E'), NaN, 'Number("\\u180E") === NaN'); + +// CHECK#2 +assert.sameValue(Number('\u180E1234567890\u180E'), NaN, 'Number("\u180E1234567890\u180E") === NaN'); + +// CHECK#3 +assert.sameValue(Number('\u180EInfinity\u180E'), NaN, 'Number("\u180EInfinity\u180E") === NaN'); + +// CHECK#4 +assert.sameValue(Number('\u180E-Infinity\u180E'), NaN, 'Number("\u180E-Infinity\u180E") === NaN'); diff --git a/test/built-ins/Number/S9.3.1_A3_T2.js b/test/built-ins/Number/S9.3.1_A3_T2.js index e398188f8c..bd6853fa7d 100644 --- a/test/built-ins/Number/S9.3.1_A3_T2.js +++ b/test/built-ins/Number/S9.3.1_A3_T2.js @@ -15,21 +15,21 @@ function dynaString(s1, s2){ } // CHECK#1 -if (Number(dynaString("\u0009\u000C\u0020\u00A0\u000B", "\u000A\u000D\u2028\u2029\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000")) !== Number("")) { - $ERROR('#1: Number("\\u0009\\u000C\\u0020\\u00A0\\u000B"+"\\u000A\\u000D\\u2028\\u2029\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000") === Number("")'); +if (Number(dynaString("\u0009\u000C\u0020\u00A0\u000B", "\u000A\u000D\u2028\u2029\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000")) !== Number("")) { + $ERROR('#1: Number("\\u0009\\u000C\\u0020\\u00A0\\u000B"+"\\u000A\\u000D\\u2028\\u2029\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000") === Number("")'); } // CHECK#2 -if (+(dynaString("\u0009\u000C\u0020\u00A0\u000A\u000D\u2028\u2029\u000B12345", "67890\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000")) !== Number("1234567890")) { - $ERROR('#2: +("\\u0009\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029\\u000B12345"+"67890\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000") === Number("1234567890")'); +if (+(dynaString("\u0009\u000C\u0020\u00A0\u000A\u000D\u2028\u2029\u000B12345", "67890\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000")) !== Number("1234567890")) { + $ERROR('#2: +("\\u0009\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029\\u000B12345"+"67890\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000") === Number("1234567890")'); } // CHECK#3 -if (!(Number(dynaString("\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029Infi", "nity\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000")) == Number("Infinity"))) { - $ERROR('#3: Number("\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029Infi"+"nity\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000") == Number("Infinity")'); +if (!(Number(dynaString("\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029Infi", "nity\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000")) == Number("Infinity"))) { + $ERROR('#3: Number("\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029Infi"+"nity\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000") == Number("Infinity")'); } // CHECK#4 -if (!(Number(dynaString("\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029-Infi", "nity\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000")) == Number(-"Infinity"))) { - $ERROR('#4: Number("\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029-Infi"+"nity\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000") == Number("-Infinity")'); +if (!(Number(dynaString("\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029-Infi", "nity\u0009\u000C\u0020\u00A0\u000B\u000A\u000D\u2028\u2029\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000")) == Number(-"Infinity"))) { + $ERROR('#4: Number("\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029-Infi"+"nity\\u0009\\u000C\\u0020\\u00A0\\u000B\\u000A\\u000D\\u2028\\u2029\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000") == Number("-Infinity")'); } diff --git a/test/built-ins/Number/S9.3.1_A3_T2_U180E.js b/test/built-ins/Number/S9.3.1_A3_T2_U180E.js new file mode 100644 index 0000000000..19cc137d90 --- /dev/null +++ b/test/built-ins/Number/S9.3.1_A3_T2_U180E.js @@ -0,0 +1,47 @@ +// Copyright 2016 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-tonumber-applied-to-the-string-type +description: > + Ensure U+180E is not recognized as whitespace, test ToNumber with dynamic string +info: > + 7.1.3.1 ToNumber Applied to the String Type + + If the grammar cannot interpret the String as an expansion of + StringNumericLiteral, then the result of ToNumber is NaN. + + StringNumericLiteral ::: + StrWhiteSpace_opt StrNumericLiteral StrWhiteSpace_opt + StrWhiteSpace ::: + StrWhiteSpaceChar StrWhiteSpace_opt + StrWhiteSpaceChar ::: + WhiteSpace + LineTerminator + WhiteSpace :: + + + + + + + + :: + Other category “Zs” code points +---*/ + +function dynaString(s1, s2){ + return String(s1) + String(s2); +} + +// CHECK#1 +assert.sameValue(Number(dynaString("", "\u180E")), NaN, 'Number(dynaString("", "\u180E")) === NaN'); + +// CHECK#2 +assert.sameValue(+(dynaString("12345", "67890\u180E")), NaN, '+(dynaString("12345", "67890\u180E")) === NaN'); + +// CHECK#3 +assert.sameValue(Number(dynaString("Infi", "nity\u180E")), NaN, 'Number(dynaString("Infi", "nity\u180E")) === NaN'); + +// CHECK#4 +assert.sameValue(Number(dynaString("-Infi", "nity\u180E")), NaN, 'Number(dynaString("-Infi", "nity\u180E")) === NaN'); diff --git a/test/built-ins/RegExp/S15.10.2.12_A1_T1.js b/test/built-ins/RegExp/S15.10.2.12_A1_T1.js index 30eb0fe341..e5e641d2dc 100644 --- a/test/built-ins/RegExp/S15.10.2.12_A1_T1.js +++ b/test/built-ins/RegExp/S15.10.2.12_A1_T1.js @@ -60,7 +60,7 @@ if (i5.replace(/\s+/g, "") !== o5) { var i6 = ""; for (var j = 6144; j < 7168; j++) i6 += String.fromCharCode(j); -var o6 = "\u1800\u1801\u1802\u1803\u1804\u1805\u1806\u1807\u1808\u1809\u180A\u180B\u180C\u180D\u180F\u1810\u1811\u1812\u1813\u1814\u1815\u1816\u1817\u1818\u1819\u181A\u181B\u181C\u181D\u181E\u181F\u1820\u1821\u1822\u1823\u1824\u1825\u1826\u1827\u1828\u1829\u182A\u182B\u182C\u182D\u182E\u182F\u1830\u1831\u1832\u1833\u1834\u1835\u1836\u1837\u1838\u1839\u183A\u183B\u183C\u183D\u183E\u183F\u1840\u1841\u1842\u1843\u1844\u1845\u1846\u1847\u1848\u1849\u184A\u184B\u184C\u184D\u184E\u184F\u1850\u1851\u1852\u1853\u1854\u1855\u1856\u1857\u1858\u1859\u185A\u185B\u185C\u185D\u185E\u185F\u1860\u1861\u1862\u1863\u1864\u1865\u1866\u1867\u1868\u1869\u186A\u186B\u186C\u186D\u186E\u186F\u1870\u1871\u1872\u1873\u1874\u1875\u1876\u1877\u1878\u1879\u187A\u187B\u187C\u187D\u187E\u187F\u1880\u1881\u1882\u1883\u1884\u1885\u1886\u1887\u1888\u1889\u188A\u188B\u188C\u188D\u188E\u188F\u1890\u1891\u1892\u1893\u1894\u1895\u1896\u1897\u1898\u1899\u189A\u189B\u189C\u189D\u189E\u189F\u18A0\u18A1\u18A2\u18A3\u18A4\u18A5\u18A6\u18A7\u18A8\u18A9\u18AA\u18AB\u18AC\u18AD\u18AE\u18AF\u18B0\u18B1\u18B2\u18B3\u18B4\u18B5\u18B6\u18B7\u18B8\u18B9\u18BA\u18BB\u18BC\u18BD\u18BE\u18BF\u18C0\u18C1\u18C2\u18C3\u18C4\u18C5\u18C6\u18C7\u18C8\u18C9\u18CA\u18CB\u18CC\u18CD\u18CE\u18CF\u18D0\u18D1\u18D2\u18D3\u18D4\u18D5\u18D6\u18D7\u18D8\u18D9\u18DA\u18DB\u18DC\u18DD\u18DE\u18DF\u18E0\u18E1\u18E2\u18E3\u18E4\u18E5\u18E6\u18E7\u18E8\u18E9\u18EA\u18EB\u18EC\u18ED\u18EE\u18EF\u18F0\u18F1\u18F2\u18F3\u18F4\u18F5\u18F6\u18F7\u18F8\u18F9\u18FA\u18FB\u18FC\u18FD\u18FE\u18FF\u1900\u1901\u1902\u1903\u1904\u1905\u1906\u1907\u1908\u1909\u190A\u190B\u190C\u190D\u190E\u190F\u1910\u1911\u1912\u1913\u1914\u1915\u1916\u1917\u1918\u1919\u191A\u191B\u191C\u191D\u191E\u191F\u1920\u1921\u1922\u1923\u1924\u1925\u1926\u1927\u1928\u1929\u192A\u192B\u192C\u192D\u192E\u192F\u1930\u1931\u1932\u1933\u1934\u1935\u1936\u1937\u1938\u1939\u193A\u193B\u193C\u193D\u193E\u193F\u1940\u1941\u1942\u1943\u1944\u1945\u1946\u1947\u1948\u1949\u194A\u194B\u194C\u194D\u194E\u194F\u1950\u1951\u1952\u1953\u1954\u1955\u1956\u1957\u1958\u1959\u195A\u195B\u195C\u195D\u195E\u195F\u1960\u1961\u1962\u1963\u1964\u1965\u1966\u1967\u1968\u1969\u196A\u196B\u196C\u196D\u196E\u196F\u1970\u1971\u1972\u1973\u1974\u1975\u1976\u1977\u1978\u1979\u197A\u197B\u197C\u197D\u197E\u197F\u1980\u1981\u1982\u1983\u1984\u1985\u1986\u1987\u1988\u1989\u198A\u198B\u198C\u198D\u198E\u198F\u1990\u1991\u1992\u1993\u1994\u1995\u1996\u1997\u1998\u1999\u199A\u199B\u199C\u199D\u199E\u199F\u19A0\u19A1\u19A2\u19A3\u19A4\u19A5\u19A6\u19A7\u19A8\u19A9\u19AA\u19AB\u19AC\u19AD\u19AE\u19AF\u19B0\u19B1\u19B2\u19B3\u19B4\u19B5\u19B6\u19B7\u19B8\u19B9\u19BA\u19BB\u19BC\u19BD\u19BE\u19BF\u19C0\u19C1\u19C2\u19C3\u19C4\u19C5\u19C6\u19C7\u19C8\u19C9\u19CA\u19CB\u19CC\u19CD\u19CE\u19CF\u19D0\u19D1\u19D2\u19D3\u19D4\u19D5\u19D6\u19D7\u19D8\u19D9\u19DA\u19DB\u19DC\u19DD\u19DE\u19DF\u19E0\u19E1\u19E2\u19E3\u19E4\u19E5\u19E6\u19E7\u19E8\u19E9\u19EA\u19EB\u19EC\u19ED\u19EE\u19EF\u19F0\u19F1\u19F2\u19F3\u19F4\u19F5\u19F6\u19F7\u19F8\u19F9\u19FA\u19FB\u19FC\u19FD\u19FE\u19FF\u1A00\u1A01\u1A02\u1A03\u1A04\u1A05\u1A06\u1A07\u1A08\u1A09\u1A0A\u1A0B\u1A0C\u1A0D\u1A0E\u1A0F\u1A10\u1A11\u1A12\u1A13\u1A14\u1A15\u1A16\u1A17\u1A18\u1A19\u1A1A\u1A1B\u1A1C\u1A1D\u1A1E\u1A1F\u1A20\u1A21\u1A22\u1A23\u1A24\u1A25\u1A26\u1A27\u1A28\u1A29\u1A2A\u1A2B\u1A2C\u1A2D\u1A2E\u1A2F\u1A30\u1A31\u1A32\u1A33\u1A34\u1A35\u1A36\u1A37\u1A38\u1A39\u1A3A\u1A3B\u1A3C\u1A3D\u1A3E\u1A3F\u1A40\u1A41\u1A42\u1A43\u1A44\u1A45\u1A46\u1A47\u1A48\u1A49\u1A4A\u1A4B\u1A4C\u1A4D\u1A4E\u1A4F\u1A50\u1A51\u1A52\u1A53\u1A54\u1A55\u1A56\u1A57\u1A58\u1A59\u1A5A\u1A5B\u1A5C\u1A5D\u1A5E\u1A5F\u1A60\u1A61\u1A62\u1A63\u1A64\u1A65\u1A66\u1A67\u1A68\u1A69\u1A6A\u1A6B\u1A6C\u1A6D\u1A6E\u1A6F\u1A70\u1A71\u1A72\u1A73\u1A74\u1A75\u1A76\u1A77\u1A78\u1A79\u1A7A\u1A7B\u1A7C\u1A7D\u1A7E\u1A7F\u1A80\u1A81\u1A82\u1A83\u1A84\u1A85\u1A86\u1A87\u1A88\u1A89\u1A8A\u1A8B\u1A8C\u1A8D\u1A8E\u1A8F\u1A90\u1A91\u1A92\u1A93\u1A94\u1A95\u1A96\u1A97\u1A98\u1A99\u1A9A\u1A9B\u1A9C\u1A9D\u1A9E\u1A9F\u1AA0\u1AA1\u1AA2\u1AA3\u1AA4\u1AA5\u1AA6\u1AA7\u1AA8\u1AA9\u1AAA\u1AAB\u1AAC\u1AAD\u1AAE\u1AAF\u1AB0\u1AB1\u1AB2\u1AB3\u1AB4\u1AB5\u1AB6\u1AB7\u1AB8\u1AB9\u1ABA\u1ABB\u1ABC\u1ABD\u1ABE\u1ABF\u1AC0\u1AC1\u1AC2\u1AC3\u1AC4\u1AC5\u1AC6\u1AC7\u1AC8\u1AC9\u1ACA\u1ACB\u1ACC\u1ACD\u1ACE\u1ACF\u1AD0\u1AD1\u1AD2\u1AD3\u1AD4\u1AD5\u1AD6\u1AD7\u1AD8\u1AD9\u1ADA\u1ADB\u1ADC\u1ADD\u1ADE\u1ADF\u1AE0\u1AE1\u1AE2\u1AE3\u1AE4\u1AE5\u1AE6\u1AE7\u1AE8\u1AE9\u1AEA\u1AEB\u1AEC\u1AED\u1AEE\u1AEF\u1AF0\u1AF1\u1AF2\u1AF3\u1AF4\u1AF5\u1AF6\u1AF7\u1AF8\u1AF9\u1AFA\u1AFB\u1AFC\u1AFD\u1AFE\u1AFF\u1B00\u1B01\u1B02\u1B03\u1B04\u1B05\u1B06\u1B07\u1B08\u1B09\u1B0A\u1B0B\u1B0C\u1B0D\u1B0E\u1B0F\u1B10\u1B11\u1B12\u1B13\u1B14\u1B15\u1B16\u1B17\u1B18\u1B19\u1B1A\u1B1B\u1B1C\u1B1D\u1B1E\u1B1F\u1B20\u1B21\u1B22\u1B23\u1B24\u1B25\u1B26\u1B27\u1B28\u1B29\u1B2A\u1B2B\u1B2C\u1B2D\u1B2E\u1B2F\u1B30\u1B31\u1B32\u1B33\u1B34\u1B35\u1B36\u1B37\u1B38\u1B39\u1B3A\u1B3B\u1B3C\u1B3D\u1B3E\u1B3F\u1B40\u1B41\u1B42\u1B43\u1B44\u1B45\u1B46\u1B47\u1B48\u1B49\u1B4A\u1B4B\u1B4C\u1B4D\u1B4E\u1B4F\u1B50\u1B51\u1B52\u1B53\u1B54\u1B55\u1B56\u1B57\u1B58\u1B59\u1B5A\u1B5B\u1B5C\u1B5D\u1B5E\u1B5F\u1B60\u1B61\u1B62\u1B63\u1B64\u1B65\u1B66\u1B67\u1B68\u1B69\u1B6A\u1B6B\u1B6C\u1B6D\u1B6E\u1B6F\u1B70\u1B71\u1B72\u1B73\u1B74\u1B75\u1B76\u1B77\u1B78\u1B79\u1B7A\u1B7B\u1B7C\u1B7D\u1B7E\u1B7F\u1B80\u1B81\u1B82\u1B83\u1B84\u1B85\u1B86\u1B87\u1B88\u1B89\u1B8A\u1B8B\u1B8C\u1B8D\u1B8E\u1B8F\u1B90\u1B91\u1B92\u1B93\u1B94\u1B95\u1B96\u1B97\u1B98\u1B99\u1B9A\u1B9B\u1B9C\u1B9D\u1B9E\u1B9F\u1BA0\u1BA1\u1BA2\u1BA3\u1BA4\u1BA5\u1BA6\u1BA7\u1BA8\u1BA9\u1BAA\u1BAB\u1BAC\u1BAD\u1BAE\u1BAF\u1BB0\u1BB1\u1BB2\u1BB3\u1BB4\u1BB5\u1BB6\u1BB7\u1BB8\u1BB9\u1BBA\u1BBB\u1BBC\u1BBD\u1BBE\u1BBF\u1BC0\u1BC1\u1BC2\u1BC3\u1BC4\u1BC5\u1BC6\u1BC7\u1BC8\u1BC9\u1BCA\u1BCB\u1BCC\u1BCD\u1BCE\u1BCF\u1BD0\u1BD1\u1BD2\u1BD3\u1BD4\u1BD5\u1BD6\u1BD7\u1BD8\u1BD9\u1BDA\u1BDB\u1BDC\u1BDD\u1BDE\u1BDF\u1BE0\u1BE1\u1BE2\u1BE3\u1BE4\u1BE5\u1BE6\u1BE7\u1BE8\u1BE9\u1BEA\u1BEB\u1BEC\u1BED\u1BEE\u1BEF\u1BF0\u1BF1\u1BF2\u1BF3\u1BF4\u1BF5\u1BF6\u1BF7\u1BF8\u1BF9\u1BFA\u1BFB\u1BFC\u1BFD\u1BFE\u1BFF"; +var o6 = "\u1800\u1801\u1802\u1803\u1804\u1805\u1806\u1807\u1808\u1809\u180A\u180B\u180C\u180D\u180E\u180F\u1810\u1811\u1812\u1813\u1814\u1815\u1816\u1817\u1818\u1819\u181A\u181B\u181C\u181D\u181E\u181F\u1820\u1821\u1822\u1823\u1824\u1825\u1826\u1827\u1828\u1829\u182A\u182B\u182C\u182D\u182E\u182F\u1830\u1831\u1832\u1833\u1834\u1835\u1836\u1837\u1838\u1839\u183A\u183B\u183C\u183D\u183E\u183F\u1840\u1841\u1842\u1843\u1844\u1845\u1846\u1847\u1848\u1849\u184A\u184B\u184C\u184D\u184E\u184F\u1850\u1851\u1852\u1853\u1854\u1855\u1856\u1857\u1858\u1859\u185A\u185B\u185C\u185D\u185E\u185F\u1860\u1861\u1862\u1863\u1864\u1865\u1866\u1867\u1868\u1869\u186A\u186B\u186C\u186D\u186E\u186F\u1870\u1871\u1872\u1873\u1874\u1875\u1876\u1877\u1878\u1879\u187A\u187B\u187C\u187D\u187E\u187F\u1880\u1881\u1882\u1883\u1884\u1885\u1886\u1887\u1888\u1889\u188A\u188B\u188C\u188D\u188E\u188F\u1890\u1891\u1892\u1893\u1894\u1895\u1896\u1897\u1898\u1899\u189A\u189B\u189C\u189D\u189E\u189F\u18A0\u18A1\u18A2\u18A3\u18A4\u18A5\u18A6\u18A7\u18A8\u18A9\u18AA\u18AB\u18AC\u18AD\u18AE\u18AF\u18B0\u18B1\u18B2\u18B3\u18B4\u18B5\u18B6\u18B7\u18B8\u18B9\u18BA\u18BB\u18BC\u18BD\u18BE\u18BF\u18C0\u18C1\u18C2\u18C3\u18C4\u18C5\u18C6\u18C7\u18C8\u18C9\u18CA\u18CB\u18CC\u18CD\u18CE\u18CF\u18D0\u18D1\u18D2\u18D3\u18D4\u18D5\u18D6\u18D7\u18D8\u18D9\u18DA\u18DB\u18DC\u18DD\u18DE\u18DF\u18E0\u18E1\u18E2\u18E3\u18E4\u18E5\u18E6\u18E7\u18E8\u18E9\u18EA\u18EB\u18EC\u18ED\u18EE\u18EF\u18F0\u18F1\u18F2\u18F3\u18F4\u18F5\u18F6\u18F7\u18F8\u18F9\u18FA\u18FB\u18FC\u18FD\u18FE\u18FF\u1900\u1901\u1902\u1903\u1904\u1905\u1906\u1907\u1908\u1909\u190A\u190B\u190C\u190D\u190E\u190F\u1910\u1911\u1912\u1913\u1914\u1915\u1916\u1917\u1918\u1919\u191A\u191B\u191C\u191D\u191E\u191F\u1920\u1921\u1922\u1923\u1924\u1925\u1926\u1927\u1928\u1929\u192A\u192B\u192C\u192D\u192E\u192F\u1930\u1931\u1932\u1933\u1934\u1935\u1936\u1937\u1938\u1939\u193A\u193B\u193C\u193D\u193E\u193F\u1940\u1941\u1942\u1943\u1944\u1945\u1946\u1947\u1948\u1949\u194A\u194B\u194C\u194D\u194E\u194F\u1950\u1951\u1952\u1953\u1954\u1955\u1956\u1957\u1958\u1959\u195A\u195B\u195C\u195D\u195E\u195F\u1960\u1961\u1962\u1963\u1964\u1965\u1966\u1967\u1968\u1969\u196A\u196B\u196C\u196D\u196E\u196F\u1970\u1971\u1972\u1973\u1974\u1975\u1976\u1977\u1978\u1979\u197A\u197B\u197C\u197D\u197E\u197F\u1980\u1981\u1982\u1983\u1984\u1985\u1986\u1987\u1988\u1989\u198A\u198B\u198C\u198D\u198E\u198F\u1990\u1991\u1992\u1993\u1994\u1995\u1996\u1997\u1998\u1999\u199A\u199B\u199C\u199D\u199E\u199F\u19A0\u19A1\u19A2\u19A3\u19A4\u19A5\u19A6\u19A7\u19A8\u19A9\u19AA\u19AB\u19AC\u19AD\u19AE\u19AF\u19B0\u19B1\u19B2\u19B3\u19B4\u19B5\u19B6\u19B7\u19B8\u19B9\u19BA\u19BB\u19BC\u19BD\u19BE\u19BF\u19C0\u19C1\u19C2\u19C3\u19C4\u19C5\u19C6\u19C7\u19C8\u19C9\u19CA\u19CB\u19CC\u19CD\u19CE\u19CF\u19D0\u19D1\u19D2\u19D3\u19D4\u19D5\u19D6\u19D7\u19D8\u19D9\u19DA\u19DB\u19DC\u19DD\u19DE\u19DF\u19E0\u19E1\u19E2\u19E3\u19E4\u19E5\u19E6\u19E7\u19E8\u19E9\u19EA\u19EB\u19EC\u19ED\u19EE\u19EF\u19F0\u19F1\u19F2\u19F3\u19F4\u19F5\u19F6\u19F7\u19F8\u19F9\u19FA\u19FB\u19FC\u19FD\u19FE\u19FF\u1A00\u1A01\u1A02\u1A03\u1A04\u1A05\u1A06\u1A07\u1A08\u1A09\u1A0A\u1A0B\u1A0C\u1A0D\u1A0E\u1A0F\u1A10\u1A11\u1A12\u1A13\u1A14\u1A15\u1A16\u1A17\u1A18\u1A19\u1A1A\u1A1B\u1A1C\u1A1D\u1A1E\u1A1F\u1A20\u1A21\u1A22\u1A23\u1A24\u1A25\u1A26\u1A27\u1A28\u1A29\u1A2A\u1A2B\u1A2C\u1A2D\u1A2E\u1A2F\u1A30\u1A31\u1A32\u1A33\u1A34\u1A35\u1A36\u1A37\u1A38\u1A39\u1A3A\u1A3B\u1A3C\u1A3D\u1A3E\u1A3F\u1A40\u1A41\u1A42\u1A43\u1A44\u1A45\u1A46\u1A47\u1A48\u1A49\u1A4A\u1A4B\u1A4C\u1A4D\u1A4E\u1A4F\u1A50\u1A51\u1A52\u1A53\u1A54\u1A55\u1A56\u1A57\u1A58\u1A59\u1A5A\u1A5B\u1A5C\u1A5D\u1A5E\u1A5F\u1A60\u1A61\u1A62\u1A63\u1A64\u1A65\u1A66\u1A67\u1A68\u1A69\u1A6A\u1A6B\u1A6C\u1A6D\u1A6E\u1A6F\u1A70\u1A71\u1A72\u1A73\u1A74\u1A75\u1A76\u1A77\u1A78\u1A79\u1A7A\u1A7B\u1A7C\u1A7D\u1A7E\u1A7F\u1A80\u1A81\u1A82\u1A83\u1A84\u1A85\u1A86\u1A87\u1A88\u1A89\u1A8A\u1A8B\u1A8C\u1A8D\u1A8E\u1A8F\u1A90\u1A91\u1A92\u1A93\u1A94\u1A95\u1A96\u1A97\u1A98\u1A99\u1A9A\u1A9B\u1A9C\u1A9D\u1A9E\u1A9F\u1AA0\u1AA1\u1AA2\u1AA3\u1AA4\u1AA5\u1AA6\u1AA7\u1AA8\u1AA9\u1AAA\u1AAB\u1AAC\u1AAD\u1AAE\u1AAF\u1AB0\u1AB1\u1AB2\u1AB3\u1AB4\u1AB5\u1AB6\u1AB7\u1AB8\u1AB9\u1ABA\u1ABB\u1ABC\u1ABD\u1ABE\u1ABF\u1AC0\u1AC1\u1AC2\u1AC3\u1AC4\u1AC5\u1AC6\u1AC7\u1AC8\u1AC9\u1ACA\u1ACB\u1ACC\u1ACD\u1ACE\u1ACF\u1AD0\u1AD1\u1AD2\u1AD3\u1AD4\u1AD5\u1AD6\u1AD7\u1AD8\u1AD9\u1ADA\u1ADB\u1ADC\u1ADD\u1ADE\u1ADF\u1AE0\u1AE1\u1AE2\u1AE3\u1AE4\u1AE5\u1AE6\u1AE7\u1AE8\u1AE9\u1AEA\u1AEB\u1AEC\u1AED\u1AEE\u1AEF\u1AF0\u1AF1\u1AF2\u1AF3\u1AF4\u1AF5\u1AF6\u1AF7\u1AF8\u1AF9\u1AFA\u1AFB\u1AFC\u1AFD\u1AFE\u1AFF\u1B00\u1B01\u1B02\u1B03\u1B04\u1B05\u1B06\u1B07\u1B08\u1B09\u1B0A\u1B0B\u1B0C\u1B0D\u1B0E\u1B0F\u1B10\u1B11\u1B12\u1B13\u1B14\u1B15\u1B16\u1B17\u1B18\u1B19\u1B1A\u1B1B\u1B1C\u1B1D\u1B1E\u1B1F\u1B20\u1B21\u1B22\u1B23\u1B24\u1B25\u1B26\u1B27\u1B28\u1B29\u1B2A\u1B2B\u1B2C\u1B2D\u1B2E\u1B2F\u1B30\u1B31\u1B32\u1B33\u1B34\u1B35\u1B36\u1B37\u1B38\u1B39\u1B3A\u1B3B\u1B3C\u1B3D\u1B3E\u1B3F\u1B40\u1B41\u1B42\u1B43\u1B44\u1B45\u1B46\u1B47\u1B48\u1B49\u1B4A\u1B4B\u1B4C\u1B4D\u1B4E\u1B4F\u1B50\u1B51\u1B52\u1B53\u1B54\u1B55\u1B56\u1B57\u1B58\u1B59\u1B5A\u1B5B\u1B5C\u1B5D\u1B5E\u1B5F\u1B60\u1B61\u1B62\u1B63\u1B64\u1B65\u1B66\u1B67\u1B68\u1B69\u1B6A\u1B6B\u1B6C\u1B6D\u1B6E\u1B6F\u1B70\u1B71\u1B72\u1B73\u1B74\u1B75\u1B76\u1B77\u1B78\u1B79\u1B7A\u1B7B\u1B7C\u1B7D\u1B7E\u1B7F\u1B80\u1B81\u1B82\u1B83\u1B84\u1B85\u1B86\u1B87\u1B88\u1B89\u1B8A\u1B8B\u1B8C\u1B8D\u1B8E\u1B8F\u1B90\u1B91\u1B92\u1B93\u1B94\u1B95\u1B96\u1B97\u1B98\u1B99\u1B9A\u1B9B\u1B9C\u1B9D\u1B9E\u1B9F\u1BA0\u1BA1\u1BA2\u1BA3\u1BA4\u1BA5\u1BA6\u1BA7\u1BA8\u1BA9\u1BAA\u1BAB\u1BAC\u1BAD\u1BAE\u1BAF\u1BB0\u1BB1\u1BB2\u1BB3\u1BB4\u1BB5\u1BB6\u1BB7\u1BB8\u1BB9\u1BBA\u1BBB\u1BBC\u1BBD\u1BBE\u1BBF\u1BC0\u1BC1\u1BC2\u1BC3\u1BC4\u1BC5\u1BC6\u1BC7\u1BC8\u1BC9\u1BCA\u1BCB\u1BCC\u1BCD\u1BCE\u1BCF\u1BD0\u1BD1\u1BD2\u1BD3\u1BD4\u1BD5\u1BD6\u1BD7\u1BD8\u1BD9\u1BDA\u1BDB\u1BDC\u1BDD\u1BDE\u1BDF\u1BE0\u1BE1\u1BE2\u1BE3\u1BE4\u1BE5\u1BE6\u1BE7\u1BE8\u1BE9\u1BEA\u1BEB\u1BEC\u1BED\u1BEE\u1BEF\u1BF0\u1BF1\u1BF2\u1BF3\u1BF4\u1BF5\u1BF6\u1BF7\u1BF8\u1BF9\u1BFA\u1BFB\u1BFC\u1BFD\u1BFE\u1BFF"; if (i6.replace(/\s+/g, "") !== o6) { $ERROR("#6: Error matching character class \s between character 1800 and 1bff"); } @@ -515,7 +515,7 @@ if (i62.replace(/\s+/g, "") !== o62) { var i63 = ""; for (var j = 64512; j < 65536; j++) { - if (j===65279) { continue;} //Ignore BOM + if (j === 0xFEFF) { continue; } //Ignore BOM i63 += String.fromCharCode(j); } var o63 = i63; @@ -523,7 +523,7 @@ if (i63.replace(/\s+/g, "") !== o63) { $ERROR("#63: Error matching character class \s between character fc00 and ffff"); } -var i64 = String.fromCharCode(65279); +var i64 = String.fromCharCode(0xFEFF); if (i64.replace(/\s/g, "") !== "") { $ERROR("#64: Error matching character class \s for BOM (feff)"); } diff --git a/test/built-ins/RegExp/S15.10.2.12_A2_T1.js b/test/built-ins/RegExp/S15.10.2.12_A2_T1.js index 2381ef6d27..a5d4f5244d 100644 --- a/test/built-ins/RegExp/S15.10.2.12_A2_T1.js +++ b/test/built-ins/RegExp/S15.10.2.12_A2_T1.js @@ -11,7 +11,7 @@ description: WhiteSpace ---*/ var i0 = ""; -for (var j = 0; j < 1024; j++) +for (var j = 0x0000; j < 0x0400; j++) i0 += String.fromCharCode(j); var o0 = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0"; if (i0.replace(/\S+/g, "") !== o0) { @@ -19,7 +19,7 @@ if (i0.replace(/\S+/g, "") !== o0) { } var i1 = ""; -for (var j = 1024; j < 2048; j++) +for (var j = 0x0400; j < 0x0800; j++) i1 += String.fromCharCode(j); var o1 = ""; if (i1.replace(/\S+/g, "") !== o1) { @@ -27,7 +27,7 @@ if (i1.replace(/\S+/g, "") !== o1) { } var i2 = ""; -for (var j = 2048; j < 3072; j++) +for (var j = 0x0800; j < 0x0C00; j++) i2 += String.fromCharCode(j); var o2 = ""; if (i2.replace(/\S+/g, "") !== o2) { @@ -35,7 +35,7 @@ if (i2.replace(/\S+/g, "") !== o2) { } var i3 = ""; -for (var j = 3072; j < 4096; j++) +for (var j = 0x0C00; j < 0x1000; j++) i3 += String.fromCharCode(j); var o3 = ""; if (i3.replace(/\S+/g, "") !== o3) { @@ -43,7 +43,7 @@ if (i3.replace(/\S+/g, "") !== o3) { } var i4 = ""; -for (var j = 4096; j < 5120; j++) +for (var j = 0x1000; j < 0x1400; j++) i4 += String.fromCharCode(j); var o4 = ""; if (i4.replace(/\S+/g, "") !== o4) { @@ -51,7 +51,7 @@ if (i4.replace(/\S+/g, "") !== o4) { } var i5 = ""; -for (var j = 5120; j < 6144; j++) +for (var j = 0x1400; j < 0x1800; j++) i5 += String.fromCharCode(j); var o5 = "\u1680"; if (i5.replace(/\S+/g, "") !== o5) { @@ -59,15 +59,15 @@ if (i5.replace(/\S+/g, "") !== o5) { } var i6 = ""; -for (var j = 6144; j < 7168; j++) +for (var j = 0x1800; j < 0x1C00; j++) i6 += String.fromCharCode(j); -var o6 = "\u180E"; +var o6 = ""; if (i6.replace(/\S+/g, "") !== o6) { $ERROR("#6: Error matching character class \S between character 1800 and 1bff"); } var i7 = ""; -for (var j = 7168; j < 8192; j++) +for (var j = 0x1C00; j < 0x2000; j++) i7 += String.fromCharCode(j); var o7 = ""; if (i7.replace(/\S+/g, "") !== o7) { @@ -75,7 +75,7 @@ if (i7.replace(/\S+/g, "") !== o7) { } var i8 = ""; -for (var j = 8192; j < 9216; j++) +for (var j = 0x2000; j < 0x2400; j++) i8 += String.fromCharCode(j); var o8 = "\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F"; if (i8.replace(/\S+/g, "") !== o8) { @@ -83,7 +83,7 @@ if (i8.replace(/\S+/g, "") !== o8) { } var i9 = ""; -for (var j = 9216; j < 10240; j++) +for (var j = 0x2400; j < 0x2800; j++) i9 += String.fromCharCode(j); var o9 = ""; if (i9.replace(/\S+/g, "") !== o9) { @@ -91,7 +91,7 @@ if (i9.replace(/\S+/g, "") !== o9) { } var i10 = ""; -for (var j = 10240; j < 11264; j++) +for (var j = 0x2800; j < 0x2C00; j++) i10 += String.fromCharCode(j); var o10 = ""; if (i10.replace(/\S+/g, "") !== o10) { @@ -99,7 +99,7 @@ if (i10.replace(/\S+/g, "") !== o10) { } var i11 = ""; -for (var j = 11264; j < 12288; j++) +for (var j = 0x2C00; j < 0x3000; j++) i11 += String.fromCharCode(j); var o11 = ""; if (i11.replace(/\S+/g, "") !== o11) { @@ -107,7 +107,7 @@ if (i11.replace(/\S+/g, "") !== o11) { } var i12 = ""; -for (var j = 12288; j < 13312; j++) +for (var j = 0x3000; j < 0x3400; j++) i12 += String.fromCharCode(j); var o12 = "\u3000"; if (i12.replace(/\S+/g, "") !== o12) { @@ -115,7 +115,7 @@ if (i12.replace(/\S+/g, "") !== o12) { } var i13 = ""; -for (var j = 13312; j < 14336; j++) +for (var j = 0x3400; j < 0x3800; j++) i13 += String.fromCharCode(j); var o13 = ""; if (i13.replace(/\S+/g, "") !== o13) { @@ -123,7 +123,7 @@ if (i13.replace(/\S+/g, "") !== o13) { } var i14 = ""; -for (var j = 14336; j < 15360; j++) +for (var j = 0x3800; j < 0x3C00; j++) i14 += String.fromCharCode(j); var o14 = ""; if (i14.replace(/\S+/g, "") !== o14) { @@ -131,7 +131,7 @@ if (i14.replace(/\S+/g, "") !== o14) { } var i15 = ""; -for (var j = 15360; j < 16384; j++) +for (var j = 0x3C00; j < 0x4000; j++) i15 += String.fromCharCode(j); var o15 = ""; if (i15.replace(/\S+/g, "") !== o15) { @@ -139,7 +139,7 @@ if (i15.replace(/\S+/g, "") !== o15) { } var i16 = ""; -for (var j = 16384; j < 17408; j++) +for (var j = 0x4000; j < 0x4400; j++) i16 += String.fromCharCode(j); var o16 = ""; if (i16.replace(/\S+/g, "") !== o16) { @@ -147,7 +147,7 @@ if (i16.replace(/\S+/g, "") !== o16) { } var i17 = ""; -for (var j = 17408; j < 18432; j++) +for (var j = 0x4400; j < 0x4800; j++) i17 += String.fromCharCode(j); var o17 = ""; if (i17.replace(/\S+/g, "") !== o17) { @@ -155,7 +155,7 @@ if (i17.replace(/\S+/g, "") !== o17) { } var i18 = ""; -for (var j = 18432; j < 19456; j++) +for (var j = 0x4800; j < 0x4C00; j++) i18 += String.fromCharCode(j); var o18 = ""; if (i18.replace(/\S+/g, "") !== o18) { @@ -163,7 +163,7 @@ if (i18.replace(/\S+/g, "") !== o18) { } var i19 = ""; -for (var j = 19456; j < 20480; j++) +for (var j = 0x4C00; j < 0x5000; j++) i19 += String.fromCharCode(j); var o19 = ""; if (i19.replace(/\S+/g, "") !== o19) { @@ -171,7 +171,7 @@ if (i19.replace(/\S+/g, "") !== o19) { } var i20 = ""; -for (var j = 20480; j < 21504; j++) +for (var j = 0x5000; j < 0x5400; j++) i20 += String.fromCharCode(j); var o20 = ""; if (i20.replace(/\S+/g, "") !== o20) { @@ -179,7 +179,7 @@ if (i20.replace(/\S+/g, "") !== o20) { } var i21 = ""; -for (var j = 21504; j < 22528; j++) +for (var j = 0x5400; j < 0x5800; j++) i21 += String.fromCharCode(j); var o21 = ""; if (i21.replace(/\S+/g, "") !== o21) { @@ -187,7 +187,7 @@ if (i21.replace(/\S+/g, "") !== o21) { } var i22 = ""; -for (var j = 22528; j < 23552; j++) +for (var j = 0x5800; j < 0x5C00; j++) i22 += String.fromCharCode(j); var o22 = ""; if (i22.replace(/\S+/g, "") !== o22) { @@ -195,7 +195,7 @@ if (i22.replace(/\S+/g, "") !== o22) { } var i23 = ""; -for (var j = 23552; j < 24576; j++) +for (var j = 0x5C00; j < 0x6000; j++) i23 += String.fromCharCode(j); var o23 = ""; if (i23.replace(/\S+/g, "") !== o23) { @@ -203,7 +203,7 @@ if (i23.replace(/\S+/g, "") !== o23) { } var i24 = ""; -for (var j = 24576; j < 25600; j++) +for (var j = 0x6000; j < 0x6400; j++) i24 += String.fromCharCode(j); var o24 = ""; if (i24.replace(/\S+/g, "") !== o24) { @@ -211,7 +211,7 @@ if (i24.replace(/\S+/g, "") !== o24) { } var i25 = ""; -for (var j = 25600; j < 26624; j++) +for (var j = 0x6400; j < 0x6800; j++) i25 += String.fromCharCode(j); var o25 = ""; if (i25.replace(/\S+/g, "") !== o25) { @@ -219,7 +219,7 @@ if (i25.replace(/\S+/g, "") !== o25) { } var i26 = ""; -for (var j = 26624; j < 27648; j++) +for (var j = 0x6800; j < 0x6C00; j++) i26 += String.fromCharCode(j); var o26 = ""; if (i26.replace(/\S+/g, "") !== o26) { @@ -227,7 +227,7 @@ if (i26.replace(/\S+/g, "") !== o26) { } var i27 = ""; -for (var j = 27648; j < 28672; j++) +for (var j = 0x6C00; j < 0x7000; j++) i27 += String.fromCharCode(j); var o27 = ""; if (i27.replace(/\S+/g, "") !== o27) { @@ -235,7 +235,7 @@ if (i27.replace(/\S+/g, "") !== o27) { } var i28 = ""; -for (var j = 28672; j < 29696; j++) +for (var j = 0x7000; j < 0x7400; j++) i28 += String.fromCharCode(j); var o28 = ""; if (i28.replace(/\S+/g, "") !== o28) { @@ -243,7 +243,7 @@ if (i28.replace(/\S+/g, "") !== o28) { } var i29 = ""; -for (var j = 29696; j < 30720; j++) +for (var j = 0x7400; j < 0x7800; j++) i29 += String.fromCharCode(j); var o29 = ""; if (i29.replace(/\S+/g, "") !== o29) { @@ -251,7 +251,7 @@ if (i29.replace(/\S+/g, "") !== o29) { } var i30 = ""; -for (var j = 30720; j < 31744; j++) +for (var j = 0x7800; j < 0x7C00; j++) i30 += String.fromCharCode(j); var o30 = ""; if (i30.replace(/\S+/g, "") !== o30) { @@ -259,7 +259,7 @@ if (i30.replace(/\S+/g, "") !== o30) { } var i31 = ""; -for (var j = 31744; j < 32768; j++) +for (var j = 0x7C00; j < 0x8000; j++) i31 += String.fromCharCode(j); var o31 = ""; if (i31.replace(/\S+/g, "") !== o31) { @@ -267,7 +267,7 @@ if (i31.replace(/\S+/g, "") !== o31) { } var i32 = ""; -for (var j = 32768; j < 33792; j++) +for (var j = 0x8000; j < 0x8400; j++) i32 += String.fromCharCode(j); var o32 = ""; if (i32.replace(/\S+/g, "") !== o32) { @@ -275,7 +275,7 @@ if (i32.replace(/\S+/g, "") !== o32) { } var i33 = ""; -for (var j = 33792; j < 34816; j++) +for (var j = 0x8400; j < 0x8800; j++) i33 += String.fromCharCode(j); var o33 = ""; if (i33.replace(/\S+/g, "") !== o33) { @@ -283,7 +283,7 @@ if (i33.replace(/\S+/g, "") !== o33) { } var i34 = ""; -for (var j = 34816; j < 35840; j++) +for (var j = 0x8800; j < 0x8C00; j++) i34 += String.fromCharCode(j); var o34 = ""; if (i34.replace(/\S+/g, "") !== o34) { @@ -291,7 +291,7 @@ if (i34.replace(/\S+/g, "") !== o34) { } var i35 = ""; -for (var j = 35840; j < 36864; j++) +for (var j = 0x8C00; j < 0x9000; j++) i35 += String.fromCharCode(j); var o35 = ""; if (i35.replace(/\S+/g, "") !== o35) { @@ -299,7 +299,7 @@ if (i35.replace(/\S+/g, "") !== o35) { } var i36 = ""; -for (var j = 36864; j < 37888; j++) +for (var j = 0x9000; j < 0x9400; j++) i36 += String.fromCharCode(j); var o36 = ""; if (i36.replace(/\S+/g, "") !== o36) { @@ -307,7 +307,7 @@ if (i36.replace(/\S+/g, "") !== o36) { } var i37 = ""; -for (var j = 37888; j < 38912; j++) +for (var j = 0x9400; j < 0x9800; j++) i37 += String.fromCharCode(j); var o37 = ""; if (i37.replace(/\S+/g, "") !== o37) { @@ -315,7 +315,7 @@ if (i37.replace(/\S+/g, "") !== o37) { } var i38 = ""; -for (var j = 38912; j < 39936; j++) +for (var j = 0x9800; j < 0x9C00; j++) i38 += String.fromCharCode(j); var o38 = ""; if (i38.replace(/\S+/g, "") !== o38) { @@ -323,7 +323,7 @@ if (i38.replace(/\S+/g, "") !== o38) { } var i39 = ""; -for (var j = 39936; j < 40960; j++) +for (var j = 0x9C00; j < 0xA000; j++) i39 += String.fromCharCode(j); var o39 = ""; if (i39.replace(/\S+/g, "") !== o39) { @@ -331,7 +331,7 @@ if (i39.replace(/\S+/g, "") !== o39) { } var i40 = ""; -for (var j = 40960; j < 41984; j++) +for (var j = 0xA000; j < 0xA400; j++) i40 += String.fromCharCode(j); var o40 = ""; if (i40.replace(/\S+/g, "") !== o40) { @@ -339,7 +339,7 @@ if (i40.replace(/\S+/g, "") !== o40) { } var i41 = ""; -for (var j = 41984; j < 43008; j++) +for (var j = 0xA400; j < 0xA800; j++) i41 += String.fromCharCode(j); var o41 = ""; if (i41.replace(/\S+/g, "") !== o41) { @@ -347,7 +347,7 @@ if (i41.replace(/\S+/g, "") !== o41) { } var i42 = ""; -for (var j = 43008; j < 44032; j++) +for (var j = 0xA800; j < 0xAC00; j++) i42 += String.fromCharCode(j); var o42 = ""; if (i42.replace(/\S+/g, "") !== o42) { @@ -355,7 +355,7 @@ if (i42.replace(/\S+/g, "") !== o42) { } var i43 = ""; -for (var j = 44032; j < 45056; j++) +for (var j = 0xAC00; j < 0xB000; j++) i43 += String.fromCharCode(j); var o43 = ""; if (i43.replace(/\S+/g, "") !== o43) { @@ -363,7 +363,7 @@ if (i43.replace(/\S+/g, "") !== o43) { } var i44 = ""; -for (var j = 45056; j < 46080; j++) +for (var j = 0xB000; j < 0xB400; j++) i44 += String.fromCharCode(j); var o44 = ""; if (i44.replace(/\S+/g, "") !== o44) { @@ -371,7 +371,7 @@ if (i44.replace(/\S+/g, "") !== o44) { } var i45 = ""; -for (var j = 46080; j < 47104; j++) +for (var j = 0xB400; j < 0xB800; j++) i45 += String.fromCharCode(j); var o45 = ""; if (i45.replace(/\S+/g, "") !== o45) { @@ -379,7 +379,7 @@ if (i45.replace(/\S+/g, "") !== o45) { } var i46 = ""; -for (var j = 47104; j < 48128; j++) +for (var j = 0xB800; j < 0xBC00; j++) i46 += String.fromCharCode(j); var o46 = ""; if (i46.replace(/\S+/g, "") !== o46) { @@ -387,7 +387,7 @@ if (i46.replace(/\S+/g, "") !== o46) { } var i47 = ""; -for (var j = 48128; j < 49152; j++) +for (var j = 0xBC00; j < 0xC000; j++) i47 += String.fromCharCode(j); var o47 = ""; if (i47.replace(/\S+/g, "") !== o47) { @@ -395,7 +395,7 @@ if (i47.replace(/\S+/g, "") !== o47) { } var i48 = ""; -for (var j = 49152; j < 50176; j++) +for (var j = 0xC000; j < 0xC400; j++) i48 += String.fromCharCode(j); var o48 = ""; if (i48.replace(/\S+/g, "") !== o48) { @@ -403,7 +403,7 @@ if (i48.replace(/\S+/g, "") !== o48) { } var i49 = ""; -for (var j = 50176; j < 51200; j++) +for (var j = 0xC400; j < 0xC800; j++) i49 += String.fromCharCode(j); var o49 = ""; if (i49.replace(/\S+/g, "") !== o49) { @@ -411,7 +411,7 @@ if (i49.replace(/\S+/g, "") !== o49) { } var i50 = ""; -for (var j = 51200; j < 52224; j++) +for (var j = 0xC800; j < 0xCC00; j++) i50 += String.fromCharCode(j); var o50 = ""; if (i50.replace(/\S+/g, "") !== o50) { @@ -419,7 +419,7 @@ if (i50.replace(/\S+/g, "") !== o50) { } var i51 = ""; -for (var j = 52224; j < 53248; j++) +for (var j = 0xCC00; j < 0xD000; j++) i51 += String.fromCharCode(j); var o51 = ""; if (i51.replace(/\S+/g, "") !== o51) { @@ -427,7 +427,7 @@ if (i51.replace(/\S+/g, "") !== o51) { } var i52 = ""; -for (var j = 53248; j < 54272; j++) +for (var j = 0xD000; j < 0xD400; j++) i52 += String.fromCharCode(j); var o52 = ""; if (i52.replace(/\S+/g, "") !== o52) { @@ -435,7 +435,7 @@ if (i52.replace(/\S+/g, "") !== o52) { } var i53 = ""; -for (var j = 54272; j < 55296; j++) +for (var j = 0xD400; j < 0xD800; j++) i53 += String.fromCharCode(j); var o53 = ""; if (i53.replace(/\S+/g, "") !== o53) { @@ -443,7 +443,7 @@ if (i53.replace(/\S+/g, "") !== o53) { } var i54 = ""; -for (var j = 55296; j < 56320; j++) +for (var j = 0xD800; j < 0xDC00; j++) i54 += String.fromCharCode(j); var o54 = ""; if (i54.replace(/\S+/g, "") !== o54) { @@ -451,7 +451,7 @@ if (i54.replace(/\S+/g, "") !== o54) { } var i55 = ""; -for (var j = 56320; j < 57344; j++) +for (var j = 0xDC00; j < 0xE000; j++) i55 += String.fromCharCode(j); var o55 = ""; if (i55.replace(/\S+/g, "") !== o55) { @@ -459,7 +459,7 @@ if (i55.replace(/\S+/g, "") !== o55) { } var i56 = ""; -for (var j = 57344; j < 58368; j++) +for (var j = 0xE000; j < 0xE400; j++) i56 += String.fromCharCode(j); var o56 = ""; if (i56.replace(/\S+/g, "") !== o56) { @@ -467,7 +467,7 @@ if (i56.replace(/\S+/g, "") !== o56) { } var i57 = ""; -for (var j = 58368; j < 59392; j++) +for (var j = 0xE400; j < 0xE800; j++) i57 += String.fromCharCode(j); var o57 = ""; if (i57.replace(/\S+/g, "") !== o57) { @@ -475,7 +475,7 @@ if (i57.replace(/\S+/g, "") !== o57) { } var i58 = ""; -for (var j = 59392; j < 60416; j++) +for (var j = 0xE800; j < 0xEC00; j++) i58 += String.fromCharCode(j); var o58 = ""; if (i58.replace(/\S+/g, "") !== o58) { @@ -483,7 +483,7 @@ if (i58.replace(/\S+/g, "") !== o58) { } var i59 = ""; -for (var j = 60416; j < 61440; j++) +for (var j = 0xEC00; j < 0xF000; j++) i59 += String.fromCharCode(j); var o59 = ""; if (i59.replace(/\S+/g, "") !== o59) { @@ -491,7 +491,7 @@ if (i59.replace(/\S+/g, "") !== o59) { } var i60 = ""; -for (var j = 61440; j < 62464; j++) +for (var j = 0xF000; j < 0xF400; j++) i60 += String.fromCharCode(j); var o60 = ""; if (i60.replace(/\S+/g, "") !== o60) { @@ -499,7 +499,7 @@ if (i60.replace(/\S+/g, "") !== o60) { } var i61 = ""; -for (var j = 62464; j < 63488; j++) +for (var j = 0xF400; j < 0xF800; j++) i61 += String.fromCharCode(j); var o61 = ""; if (i61.replace(/\S+/g, "") !== o61) { @@ -507,7 +507,7 @@ if (i61.replace(/\S+/g, "") !== o61) { } var i62 = ""; -for (var j = 63488; j < 64512; j++) +for (var j = 0xF800; j < 0xFC00; j++) i62 += String.fromCharCode(j); var o62 = ""; if (i62.replace(/\S+/g, "") !== o62) { @@ -515,8 +515,8 @@ if (i62.replace(/\S+/g, "") !== o62) { } var i63 = ""; -for (var j = 64512; j < 65536; j++) { - if (j===65279) { continue;} //Ignore BOM +for (var j = 0xFC00; j < 0x10000; j++) { + if (j === 0xFEFF) { continue; } //Ignore BOM i63 += String.fromCharCode(j); } var o63 = ""; @@ -524,7 +524,7 @@ if (i63.replace(/\S+/g, "") !== o63) { $ERROR("#63: Error matching character class \S between character fc00 and ffff"); } -var i64 = String.fromCharCode(65279); +var i64 = String.fromCharCode(0xFEFF); if (i64.replace(/\S/g, "") === "") { $ERROR("#64: Error matching character class \S for BOM (feff)"); } diff --git a/test/built-ins/String/prototype/toLocaleLowerCase/Final_Sigma_U180E.js b/test/built-ins/String/prototype/toLocaleLowerCase/Final_Sigma_U180E.js new file mode 100644 index 0000000000..0f0b820b3b --- /dev/null +++ b/test/built-ins/String/prototype/toLocaleLowerCase/Final_Sigma_U180E.js @@ -0,0 +1,59 @@ +// Copyright (C) 2016 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-string.prototype.tolocalelowercase +description: > + Check if String.prototype.toLocaleLowerCase supports conditional mappings defined in SpecialCasings, + test Final_Sigma context with Mongolian Vowel Separator +info: > + The result must be derived according to the locale-insensitive case mappings in the Unicode Character + Database (this explicitly includes not only the UnicodeData.txt file, but also all locale-insensitive + mappings in the SpecialCasings.txt file that accompanies it). +---*/ + +// SpecialCasing.txt, conditional, language-insensitive mappings. + +// ; ; ; <upper>; (<condition_list>;)? # <comment> +// 03A3; 03C2; 03A3; 03A3; Final_Sigma; # GREEK CAPITAL LETTER SIGMA +// 03A3; 03C3; 03A3; 03A3; # GREEK CAPITAL LETTER SIGMA + +// Final_Sigma is defined in Unicode 8.0, 3.13 Default Case Algorithms +// General_Category of Mongolian Vowel Separator is Cf (Format), characters in Cf are Case_Ignorable. + + +// Sigma preceded by Mongolian Vowel Separator. +assert.sameValue( + "A\u180E\u03A3".toLocaleLowerCase(), + "a\u180E\u03C2", + "Sigma preceded by LATIN CAPITAL LETTER A, MONGOLIAN VOWEL SEPARATOR" +); +assert.sameValue( + "A\u180E\u03A3B".toLocaleLowerCase(), + "a\u180E\u03C3b", + "Sigma preceded by LATIN CAPITAL LETTER A, MONGOLIAN VOWEL SEPARATOR, followed by LATIN CAPITAL LETTER B" +); + +// Sigma followed by Mongolian Vowel Separator. +assert.sameValue( + "A\u03A3\u180E".toLocaleLowerCase(), + "a\u03C2\u180E", + "Sigma preceded by LATIN CAPITAL LETTER A, followed by MONGOLIAN VOWEL SEPARATOR" +); +assert.sameValue( + "A\u03A3\u180EB".toLocaleLowerCase(), + "a\u03C3\u180Eb", + "Sigma preceded by LATIN CAPITAL LETTER A, followed by MONGOLIAN VOWEL SEPARATOR, LATIN CAPITAL LETTER B" +); + +// Sigma preceded and followed by Mongolian Vowel Separator. +assert.sameValue( + "A\u180E\u03A3\u180E".toLocaleLowerCase(), + "a\u180E\u03C2\u180E", + "Sigma preceded by LATIN CAPITAL LETTER A, MONGOLIAN VOWEL SEPARATOR, followed by MONGOLIAN VOWEL SEPARATOR" +); +assert.sameValue( + "A\u180E\u03A3\u180EB".toLocaleLowerCase(), + "a\u180E\u03C3\u180Eb", + "Sigma preceded by LATIN CAPITAL LETTER A, MONGOLIAN VOWEL SEPARATOR, followed by MONGOLIAN VOWEL SEPARATOR, LATIN CAPITAL LETTER B" +); diff --git a/test/built-ins/String/prototype/toLowerCase/Final_Sigma_U180E.js b/test/built-ins/String/prototype/toLowerCase/Final_Sigma_U180E.js new file mode 100644 index 0000000000..8d50368228 --- /dev/null +++ b/test/built-ins/String/prototype/toLowerCase/Final_Sigma_U180E.js @@ -0,0 +1,59 @@ +// Copyright (C) 2016 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-string.prototype.tolowercase +description: > + Check if String.prototype.toLowerCase supports conditional mappings defined in SpecialCasings, + test Final_Sigma context with Mongolian Vowel Separator +info: > + The result must be derived according to the locale-insensitive case mappings in the Unicode Character + Database (this explicitly includes not only the UnicodeData.txt file, but also all locale-insensitive + mappings in the SpecialCasings.txt file that accompanies it). +---*/ + +// SpecialCasing.txt, conditional, language-insensitive mappings. + +// <code>; <lower>; <title>; <upper>; (<condition_list>;)? # <comment> +// 03A3; 03C2; 03A3; 03A3; Final_Sigma; # GREEK CAPITAL LETTER SIGMA +// 03A3; 03C3; 03A3; 03A3; # GREEK CAPITAL LETTER SIGMA + +// Final_Sigma is defined in Unicode 8.0, 3.13 Default Case Algorithms +// General_Category of Mongolian Vowel Separator is Cf (Format), characters in Cf are Case_Ignorable. + + +// Sigma preceded by Mongolian Vowel Separator. +assert.sameValue( + "A\u180E\u03A3".toLowerCase(), + "a\u180E\u03C2", + "Sigma preceded by LATIN CAPITAL LETTER A, MONGOLIAN VOWEL SEPARATOR" +); +assert.sameValue( + "A\u180E\u03A3B".toLowerCase(), + "a\u180E\u03C3b", + "Sigma preceded by LATIN CAPITAL LETTER A, MONGOLIAN VOWEL SEPARATOR, followed by LATIN CAPITAL LETTER B" +); + +// Sigma followed by Mongolian Vowel Separator. +assert.sameValue( + "A\u03A3\u180E".toLowerCase(), + "a\u03C2\u180E", + "Sigma preceded by LATIN CAPITAL LETTER A, followed by MONGOLIAN VOWEL SEPARATOR" +); +assert.sameValue( + "A\u03A3\u180EB".toLowerCase(), + "a\u03C3\u180Eb", + "Sigma preceded by LATIN CAPITAL LETTER A, followed by MONGOLIAN VOWEL SEPARATOR, LATIN CAPITAL LETTER B" +); + +// Sigma preceded and followed by Mongolian Vowel Separator. +assert.sameValue( + "A\u180E\u03A3\u180E".toLowerCase(), + "a\u180E\u03C2\u180E", + "Sigma preceded by LATIN CAPITAL LETTER A, MONGOLIAN VOWEL SEPARATOR, followed by MONGOLIAN VOWEL SEPARATOR" +); +assert.sameValue( + "A\u180E\u03A3\u180EB".toLowerCase(), + "a\u180E\u03C3\u180Eb", + "Sigma preceded by LATIN CAPITAL LETTER A, MONGOLIAN VOWEL SEPARATOR, followed by MONGOLIAN VOWEL SEPARATOR, LATIN CAPITAL LETTER B" +); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-3-2.js b/test/built-ins/String/prototype/trim/15.5.4.20-3-2.js index 6be919fc02..20cf7394cd 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-3-2.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-3-2.js @@ -6,6 +6,6 @@ es5id: 15.5.4.20-3-2 description: String.prototype.trim - 'S' is a string with all WhiteSpace ---*/ - var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; +var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; assert.sameValue(whiteSpacesStr.trim(), "", 'whiteSpacesStr.trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-3-3.js b/test/built-ins/String/prototype/trim/15.5.4.20-3-3.js index 94f9121bcb..f06b76e98c 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-3-3.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-3-3.js @@ -8,8 +8,8 @@ description: > WhiteSpace and LineTerminator ---*/ - var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; - var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; - var str = whiteSpacesStr + lineTerminatorsStr; +var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; +var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; +var str = whiteSpacesStr + lineTerminatorsStr; assert.sameValue(str.trim(), "", 'str.trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-3-4.js b/test/built-ins/String/prototype/trim/15.5.4.20-3-4.js index a00b8ee11d..f430ff4d87 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-3-4.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-3-4.js @@ -8,8 +8,8 @@ description: > LineTerminator and all WhiteSpace ---*/ - var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; - var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; - var str = whiteSpacesStr + lineTerminatorsStr + "abc"; +var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; +var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; +var str = whiteSpacesStr + lineTerminatorsStr + "abc"; assert.sameValue(str.trim(), "abc", 'str.trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-3-5.js b/test/built-ins/String/prototype/trim/15.5.4.20-3-5.js index c13159165a..c488c91eeb 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-3-5.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-3-5.js @@ -8,8 +8,8 @@ description: > LineTerminator and all WhiteSpace ---*/ - var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; - var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; - var str = "abc" + whiteSpacesStr + lineTerminatorsStr ; +var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; +var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; +var str = "abc" + whiteSpacesStr + lineTerminatorsStr ; assert.sameValue(str.trim(), "abc", 'str.trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-3-6.js b/test/built-ins/String/prototype/trim/15.5.4.20-3-6.js index 875d3357bb..ec4a25f444 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-3-6.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-3-6.js @@ -9,8 +9,8 @@ description: > LineTerminator and all WhiteSpace ---*/ - var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; - var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; - var str = whiteSpacesStr + lineTerminatorsStr + "abc" + whiteSpacesStr + lineTerminatorsStr; +var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; +var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; +var str = whiteSpacesStr + lineTerminatorsStr + "abc" + whiteSpacesStr + lineTerminatorsStr; assert.sameValue(str.trim(), "abc", 'str.trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-3-7.js b/test/built-ins/String/prototype/trim/15.5.4.20-3-7.js index 65b0439f22..22b5ba4a60 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-3-7.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-3-7.js @@ -8,8 +8,8 @@ description: > LineTerminator and WhiteSpace in the middle ---*/ - var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; - var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; - var str = "ab" + whiteSpacesStr + lineTerminatorsStr + "cd"; +var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; +var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; +var str = "ab" + whiteSpacesStr + lineTerminatorsStr + "cd"; assert.sameValue(str.trim(), str, 'str.trim()'); diff --git a/test/built-ins/String/prototype/trim/u180e.js b/test/built-ins/String/prototype/trim/u180e.js new file mode 100644 index 0000000000..4232999e35 --- /dev/null +++ b/test/built-ins/String/prototype/trim/u180e.js @@ -0,0 +1,17 @@ +// Copyright (C) 2016 Mathias Bynens. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-white-space +description: > + U+180E is no longer a Unicode `Space_Separator` symbol as of Unicode v6.3.0. +info: > + String.prototype.trim ( ) + + 3. [...] The definition of white space is the union of |WhiteSpace| and + |LineTerminator|. +---*/ + +assert.sameValue("_\u180E".trim(), "_\u180E"); +assert.sameValue("\u180E".trim(), "\u180E"); +assert.sameValue("\u180E_".trim(), "\u180E_"); diff --git a/test/built-ins/parseFloat/S15.1.2.3_A2_T10.js b/test/built-ins/parseFloat/S15.1.2.3_A2_T10.js index 5b72b50bea..fe97fe848a 100644 --- a/test/built-ins/parseFloat/S15.1.2.3_A2_T10.js +++ b/test/built-ins/parseFloat/S15.1.2.3_A2_T10.js @@ -11,8 +11,8 @@ description: "StrWhiteSpaceChar :: USP" var n; var count = 0; var errorCount = 0; -var uspU = ["\u1680", "\u180E", "\u2000", "\u2001", "\u2002", "\u2003", "\u2004", "\u2005", "\u2006", "\u2007", "\u2008", "\u2009", "\u200A", "\u202F", "\u205F", "\u3000"]; -var uspS = ["1680", "180E", "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "200A", "202F", "205F", "3000"]; +var uspU = ["\u1680", "\u2000", "\u2001", "\u2002", "\u2003", "\u2004", "\u2005", "\u2006", "\u2007", "\u2008", "\u2009", "\u200A", "\u202F", "\u205F", "\u3000"]; +var uspS = ["1680", "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "200A", "202F", "205F", "3000"]; for (var index = 0; index < uspU.length; index++) { var result = true; n = false; @@ -35,6 +35,6 @@ for (var index = 0; index < uspU.length; index++) { count++; } -if (errorCount > 0) { +if (errorCount > 0) { $ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count); } diff --git a/test/built-ins/parseFloat/S15.1.2.3_A2_T10_U180E.js b/test/built-ins/parseFloat/S15.1.2.3_A2_T10_U180E.js new file mode 100644 index 0000000000..6d29aebd9d --- /dev/null +++ b/test/built-ins/parseFloat/S15.1.2.3_A2_T10_U180E.js @@ -0,0 +1,27 @@ +// Copyright (C) 2016 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-parsefloat-string +description: > + Leading U+180E is not recognized as whitespace +info: > + 18.2.4 parseFloat (string) + + ... + 3. Let trimmedString be a substring of inputString consisting of the + leftmost code unit that is not a StrWhiteSpaceChar and all code units + to the right of that code unit. (In other words, remove leading white + space.) If inputString does not contain any such code units, let + trimmedString be the empty string. + 4. If neither trimmedString nor any prefix of trimmedString satisfies the + syntax of a StrDecimalLiteral (see 7.1.3.1), return NaN. + ... + +---*/ + +var mongolianVowelSeparator = "\u180E"; + +assert.sameValue(parseFloat(mongolianVowelSeparator + "1.1"), NaN, "Single leading U+180E"); +assert.sameValue(parseFloat(mongolianVowelSeparator + mongolianVowelSeparator + mongolianVowelSeparator + "1.1"), NaN, "Multiple leading U+180E"); +assert.sameValue(parseFloat(mongolianVowelSeparator), NaN, "Only U+180E"); diff --git a/test/built-ins/parseInt/S15.1.2.2_A2_T10.js b/test/built-ins/parseInt/S15.1.2.2_A2_T10.js index e23704e3be..3736f4d982 100644 --- a/test/built-ins/parseInt/S15.1.2.2_A2_T10.js +++ b/test/built-ins/parseInt/S15.1.2.2_A2_T10.js @@ -11,8 +11,8 @@ description: "StrWhiteSpaceChar :: USP" var n; var count = 0; var errorCount = 0; -var uspU = ["\u1680", "\u180E", "\u2000", "\u2001", "\u2002", "\u2003", "\u2004", "\u2005", "\u2006", "\u2007", "\u2008", "\u2009", "\u200A", "\u202F", "\u205F", "\u3000"]; -var uspS = ["1680", "180E", "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "200A", "202F", "205F", "3000"]; +var uspU = ["\u1680", "\u2000", "\u2001", "\u2002", "\u2003", "\u2004", "\u2005", "\u2006", "\u2007", "\u2008", "\u2009", "\u200A", "\u202F", "\u205F", "\u3000"]; +var uspS = ["1680", "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "200A", "202F", "205F", "3000"]; for (var index = 0; index < uspU.length; index++) { var result = true; @@ -36,6 +36,6 @@ for (var index = 0; index < uspU.length; index++) { count++; } -if (errorCount > 0) { +if (errorCount > 0) { $ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count); } diff --git a/test/built-ins/parseInt/S15.1.2.2_A2_T10_U180E.js b/test/built-ins/parseInt/S15.1.2.2_A2_T10_U180E.js new file mode 100644 index 0000000000..363383b925 --- /dev/null +++ b/test/built-ins/parseInt/S15.1.2.2_A2_T10_U180E.js @@ -0,0 +1,29 @@ +// Copyright (C) 2016 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-parseint-string-radix +description: > + Leading U+180E is not recognized as whitespace +info: > + 18.2.5 parseInt (string , radix) + + ... + 3. Let S be a newly created substring of inputString consisting of the + first code unit that is not a StrWhiteSpaceChar and all code units + following that code unit. (In other words, remove leading white + space.) If inputString does not contain any such code unit, let S + be the empty string + ... + 13. If S contains a code unit that is not a radix-R digit, let Z be + the substring of S consisting of all code units before the first + such code unit; otherwise, let Z be S. + 14. If Z is empty, return NaN. + ... +---*/ + +var mongolianVowelSeparator = "\u180E"; + +assert.sameValue(parseInt(mongolianVowelSeparator + "1"), NaN, "Single leading U+180E"); +assert.sameValue(parseInt(mongolianVowelSeparator + mongolianVowelSeparator + mongolianVowelSeparator + "1"), NaN, "Multiple leading U+180E"); +assert.sameValue(parseInt(mongolianVowelSeparator), NaN, "Only U+180E"); diff --git a/test/language/comments/mongolian-vowel-separator-multi.js b/test/language/comments/mongolian-vowel-separator-multi.js new file mode 100644 index 0000000000..70a52708d0 --- /dev/null +++ b/test/language/comments/mongolian-vowel-separator-multi.js @@ -0,0 +1,25 @@ +// Copyright (C) 2016 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-unicode-format-control-characters +description: > + Mongolian Vowel Separator can appear in multi-line comments. +info: > + 11.1 Unicode Format-Control Characters + + The Unicode format-control characters (i.e., the characters in category “Cf” + in the Unicode Character Database such as LEFT-TO-RIGHT MARK or RIGHT-TO-LEFT + MARK) are control codes used to control the formatting of a range of text in + the absence of higher-level protocols for this (such as mark-up languages). + + It is useful to allow format-control characters in source text to facilitate + editing and display. All format control characters may be used within comments, + and within string literals, template literals, and regular expression literals. +---*/ + +// U+180E in comments; UTF8(0x180E) = 0xE1 0xA0 0x8E +assert.sameValue( + 0, /*᠎ multi-line comment with U+180E */ + 0 +); diff --git a/test/language/comments/mongolian-vowel-separator-single-eval.js b/test/language/comments/mongolian-vowel-separator-single-eval.js new file mode 100644 index 0000000000..9c0705ac06 --- /dev/null +++ b/test/language/comments/mongolian-vowel-separator-single-eval.js @@ -0,0 +1,21 @@ +// Copyright (C) 2016 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-unicode-format-control-characters +description: > + Mongolian Vowel Separator can appear in single-line comments (eval code). +info: > + 11.1 Unicode Format-Control Characters + + The Unicode format-control characters (i.e., the characters in category “Cf” + in the Unicode Character Database such as LEFT-TO-RIGHT MARK or RIGHT-TO-LEFT + MARK) are control codes used to control the formatting of a range of text in + the absence of higher-level protocols for this (such as mark-up languages). + + It is useful to allow format-control characters in source text to facilitate + editing and display. All format control characters may be used within comments, + and within string literals, template literals, and regular expression literals. +---*/ + +assert.sameValue(eval("0 //\u180E"), 0); diff --git a/test/language/comments/mongolian-vowel-separator-single.js b/test/language/comments/mongolian-vowel-separator-single.js new file mode 100644 index 0000000000..c1704522bf --- /dev/null +++ b/test/language/comments/mongolian-vowel-separator-single.js @@ -0,0 +1,25 @@ +// Copyright (C) 2016 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-unicode-format-control-characters +description: > + Mongolian Vowel Separator can appear in single-line comments. +info: > + 11.1 Unicode Format-Control Characters + + The Unicode format-control characters (i.e., the characters in category “Cf” + in the Unicode Character Database such as LEFT-TO-RIGHT MARK or RIGHT-TO-LEFT + MARK) are control codes used to control the formatting of a range of text in + the absence of higher-level protocols for this (such as mark-up languages). + + It is useful to allow format-control characters in source text to facilitate + editing and display. All format control characters may be used within comments, + and within string literals, template literals, and regular expression literals. +---*/ + +// U+180E in comments; UTF8(0x180E) = 0xE1 0xA0 0x8E +assert.sameValue( + 0, //᠎ single-line comment with U+180E + 0 +); diff --git a/test/language/expressions/template-literal/mongolian-vowel-separator-eval.js b/test/language/expressions/template-literal/mongolian-vowel-separator-eval.js new file mode 100644 index 0000000000..74f73fcd4e --- /dev/null +++ b/test/language/expressions/template-literal/mongolian-vowel-separator-eval.js @@ -0,0 +1,21 @@ +// Copyright (C) 2016 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-unicode-format-control-characters +description: > + Mongolian Vowel Separator can appear in template literals (eval code). +info: > + 11.1 Unicode Format-Control Characters + + The Unicode format-control characters (i.e., the characters in category “Cf” + in the Unicode Character Database such as LEFT-TO-RIGHT MARK or RIGHT-TO-LEFT + MARK) are control codes used to control the formatting of a range of text in + the absence of higher-level protocols for this (such as mark-up languages). + + It is useful to allow format-control characters in source text to facilitate + editing and display. All format control characters may be used within comments, + and within string literals, template literals, and regular expression literals. +---*/ + +assert.sameValue(eval("`\u180E`"), "\u180E"); diff --git a/test/language/expressions/template-literal/mongolian-vowel-separator.js b/test/language/expressions/template-literal/mongolian-vowel-separator.js new file mode 100644 index 0000000000..5e423434ba --- /dev/null +++ b/test/language/expressions/template-literal/mongolian-vowel-separator.js @@ -0,0 +1,22 @@ +// Copyright (C) 2016 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-unicode-format-control-characters +description: > + Mongolian Vowel Separator can appear in template literals. +info: > + 11.1 Unicode Format-Control Characters + + The Unicode format-control characters (i.e., the characters in category “Cf” + in the Unicode Character Database such as LEFT-TO-RIGHT MARK or RIGHT-TO-LEFT + MARK) are control codes used to control the formatting of a range of text in + the absence of higher-level protocols for this (such as mark-up languages). + + It is useful to allow format-control characters in source text to facilitate + editing and display. All format control characters may be used within comments, + and within string literals, template literals, and regular expression literals. +---*/ + +// U+180E in template literals; UTF8(0x180E) = 0xE1 0xA0 0x8E +assert.sameValue(`᠎`, "\u180E"); diff --git a/test/language/literals/regexp/mongolian-vowel-separator-eval.js b/test/language/literals/regexp/mongolian-vowel-separator-eval.js new file mode 100644 index 0000000000..119336373f --- /dev/null +++ b/test/language/literals/regexp/mongolian-vowel-separator-eval.js @@ -0,0 +1,21 @@ +// Copyright (C) 2016 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-unicode-format-control-characters +description: > + Mongolian Vowel Separator can appear in regular expression literals (eval code). +info: > + 11.1 Unicode Format-Control Characters + + The Unicode format-control characters (i.e., the characters in category “Cf” + in the Unicode Character Database such as LEFT-TO-RIGHT MARK or RIGHT-TO-LEFT + MARK) are control codes used to control the formatting of a range of text in + the absence of higher-level protocols for this (such as mark-up languages). + + It is useful to allow format-control characters in source text to facilitate + editing and display. All format control characters may be used within comments, + and within string literals, template literals, and regular expression literals. +---*/ + +assert.sameValue(eval("/\u180E/").source, "\u180E"); diff --git a/test/language/literals/regexp/mongolian-vowel-separator.js b/test/language/literals/regexp/mongolian-vowel-separator.js new file mode 100644 index 0000000000..d7871f8ffe --- /dev/null +++ b/test/language/literals/regexp/mongolian-vowel-separator.js @@ -0,0 +1,22 @@ +// Copyright (C) 2016 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-unicode-format-control-characters +description: > + Mongolian Vowel Separator can appear in regular expression literals. +info: > + 11.1 Unicode Format-Control Characters + + The Unicode format-control characters (i.e., the characters in category “Cf” + in the Unicode Character Database such as LEFT-TO-RIGHT MARK or RIGHT-TO-LEFT + MARK) are control codes used to control the formatting of a range of text in + the absence of higher-level protocols for this (such as mark-up languages). + + It is useful to allow format-control characters in source text to facilitate + editing and display. All format control characters may be used within comments, + and within string literals, template literals, and regular expression literals. +---*/ + +// U+180E in regular expressions; UTF8(0x180E) = 0xE1 0xA0 0x8E +assert.sameValue(/᠎/.source, "\u180E"); diff --git a/test/language/literals/string/mongolian-vowel-separator-eval.js b/test/language/literals/string/mongolian-vowel-separator-eval.js new file mode 100644 index 0000000000..e776bb24ad --- /dev/null +++ b/test/language/literals/string/mongolian-vowel-separator-eval.js @@ -0,0 +1,21 @@ +// Copyright (C) 2016 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-unicode-format-control-characters +description: > + Mongolian Vowel Separator can appear in string literals (eval code). +info: > + 11.1 Unicode Format-Control Characters + + The Unicode format-control characters (i.e., the characters in category “Cf” + in the Unicode Character Database such as LEFT-TO-RIGHT MARK or RIGHT-TO-LEFT + MARK) are control codes used to control the formatting of a range of text in + the absence of higher-level protocols for this (such as mark-up languages). + + It is useful to allow format-control characters in source text to facilitate + editing and display. All format control characters may be used within comments, + and within string literals, template literals, and regular expression literals. +---*/ + +assert.sameValue(eval("'\u180E'"), "\u180E"); diff --git a/test/language/literals/string/mongolian-vowel-separator.js b/test/language/literals/string/mongolian-vowel-separator.js new file mode 100644 index 0000000000..d00de839a9 --- /dev/null +++ b/test/language/literals/string/mongolian-vowel-separator.js @@ -0,0 +1,22 @@ +// Copyright (C) 2016 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-unicode-format-control-characters +description: > + Mongolian Vowel Separator can appear in string literals. +info: > + 11.1 Unicode Format-Control Characters + + The Unicode format-control characters (i.e., the characters in category “Cf” + in the Unicode Character Database such as LEFT-TO-RIGHT MARK or RIGHT-TO-LEFT + MARK) are control codes used to control the formatting of a range of text in + the absence of higher-level protocols for this (such as mark-up languages). + + It is useful to allow format-control characters in source text to facilitate + editing and display. All format control characters may be used within comments, + and within string literals, template literals, and regular expression literals. +---*/ + +// U+180E in strings; UTF8(0x180E) = 0xE1 0xA0 0x8E +assert.sameValue("᠎", "\u180E"); diff --git a/test/language/white-space/mongolian-vowel-separator-eval.js b/test/language/white-space/mongolian-vowel-separator-eval.js new file mode 100644 index 0000000000..4fc23d7c83 --- /dev/null +++ b/test/language/white-space/mongolian-vowel-separator-eval.js @@ -0,0 +1,28 @@ +// Copyright (C) 2016 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-white-space +description: > + Mongolian Vowel Separator is not recognized as white space (eval code). +info: > + 11.2 White Space + + WhiteSpace :: + <TAB> + <VT> + <FF> + <SP> + <NBSP> + <ZWNBSP> + <USP> + <USP> :: + Other category “Zs” code points + + General Category of U+180E is “Cf” (Format). +---*/ + +// U+180E between "var" and "foo". +assert.throws(SyntaxError, function() { + eval("var\u180Efoo;"); +}); diff --git a/test/language/white-space/mongolian-vowel-separator.js b/test/language/white-space/mongolian-vowel-separator.js new file mode 100644 index 0000000000..1229707a9e --- /dev/null +++ b/test/language/white-space/mongolian-vowel-separator.js @@ -0,0 +1,27 @@ +// Copyright (C) 2016 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-white-space +description: > + Mongolian Vowel Separator is not recognized as white space. +info: > + 11.2 White Space + + WhiteSpace :: + <TAB> + <VT> + <FF> + <SP> + <NBSP> + <ZWNBSP> + <USP> + <USP> :: + Other category “Zs” code points + + General Category of U+180E is “Cf” (Format). +negative: SyntaxError +---*/ + +// U+180E between "var" and "foo"; UTF8(0x180E) = 0xE1 0xA0 0x8E +var᠎foo;