diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase')
30 files changed, 1079 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/Final_Sigma_U180E.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/Final_Sigma_U180E.js new file mode 100644 index 0000000000..a4a033efb7 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/Final_Sigma_U180E.js @@ -0,0 +1,62 @@ +// 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). +features: [u180e] +---*/ + +// 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".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" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A10.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A10.js new file mode 100644 index 0000000000..2ded16975e --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A10.js @@ -0,0 +1,37 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + The String.prototype.toLocaleLowerCase.length property has the attribute + ReadOnly +es5id: 15.5.4.17_A10 +description: > + Checking if varying the String.prototype.toLocaleLowerCase.length + property fails +includes: [propertyHelper.js] +---*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.toLocaleLowerCase.hasOwnProperty('length'))) { + throw new Test262Error('#1: String.prototype.toLocaleLowerCase.hasOwnProperty(\'length\') return true. Actual: ' + String.prototype.toLocaleLowerCase.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +var __obj = String.prototype.toLocaleLowerCase.length; + +verifyNotWritable(String.prototype.toLocaleLowerCase, "length", null, function() { + return "shifted"; +}); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.toLocaleLowerCase.length !== __obj) { + throw new Test262Error('#2: __obj = String.prototype.toLocaleLowerCase.length; String.prototype.toLocaleLowerCase.length = function(){return "shifted";}; String.prototype.toLocaleLowerCase.length === __obj. Actual: ' + String.prototype.toLocaleLowerCase.length); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A11.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A11.js new file mode 100644 index 0000000000..debab23e39 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A11.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The length property of the toLocaleLowerCase method is 0 +es5id: 15.5.4.17_A11 +description: Checking String.prototype.toLocaleLowerCase.length +---*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.toLocaleLowerCase.hasOwnProperty("length"))) { + throw new Test262Error('#1: String.prototype.toLocaleLowerCase.hasOwnProperty("length") return true. Actual: ' + String.prototype.toLocaleLowerCase.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.toLocaleLowerCase.length !== 0) { + throw new Test262Error('#2: String.prototype.toLocaleLowerCase.length === 0. Actual: ' + String.prototype.toLocaleLowerCase.length); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T1.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T1.js new file mode 100644 index 0000000000..a1c589a0a7 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T1.js @@ -0,0 +1,22 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: String.prototype.toLocaleLowerCase() +es5id: 15.5.4.17_A1_T1 +description: Arguments is true, and instance is object +---*/ + +var __instance = new Object(true); + +__instance.toLocaleLowerCase = String.prototype.toLocaleLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.toLocaleLowerCase() !== "true") { + throw new Test262Error('#1: __instance = new Object(true); __instance.toLocaleLowerCase = String.prototype.toLocaleLowerCase; __instance.toLocaleLowerCase() === "true". Actual: ' + __instance.toLocaleLowerCase()); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T10.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T10.js new file mode 100644 index 0000000000..bcf3194fdf --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T10.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: String.prototype.toLocaleLowerCase() +es5id: 15.5.4.17_A1_T10 +description: > + Call toLocaleLowerCase() function of object with overrode toString + function +---*/ + +var __obj = { + toString: function() { + return "\u0041B"; + } +} +__obj.toLocaleLowerCase = String.prototype.toLocaleLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__obj.toLocaleLowerCase() !== "ab") { + throw new Test262Error('#1: var __obj = {toString:function(){return "\u0041B";}}; __obj.toLocaleLowerCase = String.prototype.toLocaleLowerCase; __obj.toLocaleLowerCase() ==="ab". Actual: ' + __obj.toLocaleLowerCase()); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T11.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T11.js new file mode 100644 index 0000000000..a5e13954aa --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T11.js @@ -0,0 +1,32 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: String.prototype.toLocaleLowerCase() +es5id: 15.5.4.17_A1_T11 +description: > + Override toString function, toString throw exception, then call + toLocaleLowerCase() function for this object +---*/ + +var __obj = { + toString: function() { + throw "intostr"; + } +} +__obj.toLocaleLowerCase = String.prototype.toLocaleLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var x = __obj.toLocaleLowerCase(); + throw new Test262Error('#1: "var x = __obj.toLocaleLowerCase()" lead to throwing exception'); +} catch (e) { + if (e !== "intostr") { + throw new Test262Error('#1.1: Exception === "intostr". Actual: ' + e); + } +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T12.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T12.js new file mode 100644 index 0000000000..05b7bebbfd --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T12.js @@ -0,0 +1,35 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: String.prototype.toLocaleLowerCase() +es5id: 15.5.4.17_A1_T12 +description: > + Override toString and valueOf functions, valueOf throw exception, + then call toLocaleLowerCase() function for this object +---*/ + +var __obj = { + toString: function() { + return {}; + }, + valueOf: function() { + throw "intostr"; + } +} +__obj.toLocaleLowerCase = String.prototype.toLocaleLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var x = __obj.toLocaleLowerCase(); + throw new Test262Error('#1: "var x = __obj.toLocaleLowerCase()" lead to throwing exception'); +} catch (e) { + if (e !== "intostr") { + throw new Test262Error('#1.1: Exception === "intostr". Actual: ' + e); + } +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T13.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T13.js new file mode 100644 index 0000000000..83236032ed --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T13.js @@ -0,0 +1,38 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: String.prototype.toLocaleLowerCase() +es5id: 15.5.4.17_A1_T13 +description: > + Override toString and valueOf functions, then call + toLocaleLowerCase() function for this object +---*/ + +var __obj = { + toString: function() { + return {}; + }, + valueOf: function() { + return 1; + } +} +__obj.toLocaleLowerCase = String.prototype.toLocaleLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__obj.toLocaleLowerCase() !== "1") { + throw new Test262Error('#1: var __obj = {toString:function(){return {};},valueOf:function(){return 1;}}; __obj.toLocaleLowerCase = String.prototype.toLocaleLowerCase; __obj.toLocaleLowerCase() ==="1". Actual: ' + __obj.toLocaleLowerCase()); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__obj.toLocaleLowerCase().length !== 1) { + throw new Test262Error('#2: var __obj = {toString:function(){return {};},valueOf:function(){return 1;}}; __obj.toLocaleLowerCase = String.prototype.toLocaleLowerCase; __obj.toLocaleLowerCase().length === 1. Actual: ' + __obj.toLocaleLowerCase().length); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T14.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T14.js new file mode 100644 index 0000000000..99fdc2b935 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T14.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: String.prototype.toLocaleLowerCase() +es5id: 15.5.4.17_A1_T14 +description: Call toLocaleLowerCase() function for RegExp object +---*/ + +var __reg = new RegExp("ABC"); +__reg.toLocaleLowerCase = String.prototype.toLocaleLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__reg.toLocaleLowerCase() !== "/abc/") { + throw new Test262Error('#1: var __reg = new RegExp("ABC"); __reg.toLocaleLowerCase = String.prototype.toLocaleLowerCase; __reg.toLocaleLowerCase() === "/abc/". Actual: ' + __reg.toLocaleLowerCase()); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T2.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T2.js new file mode 100644 index 0000000000..4d1fa0e042 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T2.js @@ -0,0 +1,22 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: String.prototype.toLocaleLowerCase() +es5id: 15.5.4.17_A1_T2 +description: Instance is Boolean object +---*/ + +var __instance = new Boolean; + +__instance.toLocaleLowerCase = String.prototype.toLocaleLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.toLocaleLowerCase() !== "false") { + throw new Test262Error('#1: __instance = new Boolean; __instance.toLocaleLowerCase = String.prototype.toLocaleLowerCase; __instance.toLocaleLowerCase() === "false". Actual: ' + __instance.toLocaleLowerCase()); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T3.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T3.js new file mode 100644 index 0000000000..9798385f74 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T3.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: String.prototype.toLocaleLowerCase() +es5id: 15.5.4.17_A1_T3 +description: Checking by using eval +---*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (eval("\"BJ\"").toLocaleLowerCase() !== "bj") { + throw new Test262Error('#1: eval("\\"BJ\\"").toLocaleLowerCase() === "bj". Actual: ' + eval("\"BJ\"").toLocaleLowerCase()); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T4.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T4.js new file mode 100644 index 0000000000..5dccd7105f --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T4.js @@ -0,0 +1,48 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: String.prototype.toLocaleLowerCase() +es5id: 15.5.4.17_A1_T4 +description: > + Call toLocaleLowerCase() function without arguments of string and + from empty string +---*/ + +var __lowerCase = "".toLocaleLowerCase(); + +var __expected = ""; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__lowerCase.length !== __expected.length) { + throw new Test262Error('#1: __lowerCase = "".toLocaleLowerCase(); __expected = ""; __lowerCase.length === __expected.length. Actual: ' + __lowerCase.length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__lowerCase.index !== __expected.index) { + throw new Test262Error('#2: __lowerCase = "".toLocaleLowerCase(); __expected = ""; __lowerCase.index === __expected.index. Actual: ' + __lowerCase.index); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__lowerCase.input !== __expected.input) { + throw new Test262Error('#3: __lowerCase = "".toLocaleLowerCase(); __expected = ""; __lowerCase.input === __expected.input. Actual: ' + __lowerCase.input); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__lowerCase[0] !== __expected[0]) { + throw new Test262Error('#4: __lowerCase = "".toLocaleLowerCase(); __expected = ""; __lowerCase[0]===__expected[0]. Actual: ' + __lowerCase[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T5.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T5.js new file mode 100644 index 0000000000..34618bd677 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T5.js @@ -0,0 +1,23 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: String.prototype.toLocaleLowerCase() +es5id: 15.5.4.17_A1_T5 +description: Call toLocaleLowerCase() function for function call +---*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(null) evaluates to "null" match(null) evaluates to match("null") +if (function() { + return "GnulLuNa" + }().toLocaleLowerCase() !== "gnulluna") { + throw new Test262Error('#1: function(){return "GnulLuNa"}().toLocaleLowerCase() === "gnulluna". Actual: ' + function() { + return "GnulLuNa" + }().toLocaleLowerCase()); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T6.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T6.js new file mode 100644 index 0000000000..0268b030e4 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T6.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: String.prototype.toLocaleLowerCase() +es5id: 15.5.4.17_A1_T6 +description: Call toLocaleLowerCase() function of Number.NEGATIVE_INFINITY +---*/ + +Number.prototype.toLocaleLowerCase = String.prototype.toLocaleLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ((Number.NEGATIVE_INFINITY).toLocaleLowerCase() !== "-infinity") { + throw new Test262Error('#1: Number.prototype.toLocaleLowerCase = String.prototype.toLocaleLowerCase; (Number.NEGATIVE_INFINITY).toLocaleLowerCase() === "-infinity". Actual: ' + (Number.NEGATIVE_INFINITY).toLocaleLowerCase()); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T7.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T7.js new file mode 100644 index 0000000000..285ee723ec --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T7.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: String.prototype.toLocaleLowerCase() +es5id: 15.5.4.17_A1_T7 +description: Call toLocaleLowerCase() function of NaN +---*/ + +Number.prototype.toLocaleLowerCase = String.prototype.toLocaleLowerCase; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (NaN.toLocaleLowerCase() !== "nan") { + throw new Test262Error('#1: Number.prototype.toLocaleLowerCase = String.prototype.toLocaleLowerCase; NaN.toLocaleLowerCase()=== "nan". Actual: ' + NaN.toLocaleLowerCase()); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T8.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T8.js new file mode 100644 index 0000000000..1967c6547d --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T8.js @@ -0,0 +1,16 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: String.prototype.toLocaleLowerCase() +es5id: 15.5.4.17_A1_T8 +description: Call toLocaleLowerCase() function of Infinity +---*/ + +Number.prototype.toLocaleLowerCase = String.prototype.toLocaleLowerCase; + +if (Infinity.toLocaleLowerCase() !== "infinity") { + throw new Test262Error('#1: Number.prototype.toLocaleLowerCase = String.prototype.toLocaleLowerCase; Infinity.toLocaleLowerCase()=== "infinity". Actual: ' + Infinity.toLocaleLowerCase()); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T9.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T9.js new file mode 100644 index 0000000000..9defa73f86 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A1_T9.js @@ -0,0 +1,54 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: String.prototype.toLocaleLowerCase() +es5id: 15.5.4.17_A1_T9 +description: Call toLocaleLowerCase() function of string object +---*/ + +var __obj = { + valueOf: function() {}, + toString: void 0 +}; + +var __lowerCase = new String(__obj).toLocaleLowerCase(); + + +var __expected = "undefined"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__lowerCase.length !== __expected.length) { + throw new Test262Error('#1: __obj = {valueOf:function(){}, toString:void 0}; __lowerCase = new String(__obj).toLocaleLowerCase(); __expected ="undefined"; __lowerCase.length === __expected.length. Actual: ' + __lowerCase.length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__lowerCase.index !== __expected.index) { + throw new Test262Error('#2: __obj = {valueOf:function(){}, toString:void 0}; __lowerCase = new String(__obj).toLocaleLowerCase(); __expected ="undefined"; __lowerCase.index === __expected.index. Actual: ' + __lowerCase.index); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__lowerCase.input !== __expected.input) { + throw new Test262Error('#3: __obj = {valueOf:function(){}, toString:void 0}; __lowerCase = new String(__obj).toLocaleLowerCase(); __expected ="undefined"; __lowerCase.input === __expected.input. Actual: ' + __lowerCase.input); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +for (var index = 0; index < __expected.length; index++) { + if (__lowerCase[index] !== __expected[index]) { + throw new Test262Error('#4.' + index + ': __obj = {valueOf:function(){}, toString:void 0}; __lowerCase = new String(__obj).toLocaleLowerCase(); __expected ="undefined"; __lowerCase[' + index + ']=== ' + __expected[index] + '. Actual: ' + __lowerCase[index]); + } +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A2_T1.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A2_T1.js new file mode 100644 index 0000000000..7dfdb60f3e --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A2_T1.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + String.prototype.toLocaleLowerCase() return a string, but not a String + object +es5id: 15.5.4.17_A2_T1 +description: Checking returned result +---*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("Hello, WoRlD!".toLocaleLowerCase() !== "hello, world!") { + throw new Test262Error('#1: "Hello, WoRlD!".toLocaleLowerCase() === "hello, world!". Actual: ' + ("Hello, WoRlD!".toLocaleLowerCase())); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if ("Hello, WoRlD!".toLocaleLowerCase() !== String("hello, world!")) { + throw new Test262Error('#2: "Hello, WoRlD!".toLocaleLowerCase() === String("hello, world!"). Actual: ' + ("Hello, WoRlD!".toLocaleLowerCase())); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if ("Hello, WoRlD!".toLocaleLowerCase() === new String("hello, world!")) { + throw new Test262Error('#3: "Hello, WoRlD!".toLocaleLowerCase() !== new String("hello, world!")'); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A6.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A6.js new file mode 100644 index 0000000000..dadbf9893d --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A6.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: String.prototype.toLocaleLowerCase has not prototype property +es5id: 15.5.4.17_A6 +description: Checking String.prototype.toLocaleLowerCase.prototype +---*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.prototype.toLocaleLowerCase.prototype !== undefined) { + throw new Test262Error('#1: String.prototype.toLocaleLowerCase.prototype === undefined. Actual: ' + String.prototype.toLocaleLowerCase.prototype); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A7.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A7.js new file mode 100644 index 0000000000..48e315755d --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A7.js @@ -0,0 +1,23 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: String.prototype.toLocaleLowerCase can't be used as constructor +es5id: 15.5.4.17_A7 +description: > + Checking if creating the String.prototype.toLocaleLowerCase object + fails +---*/ + +var __FACTORY = String.prototype.toLocaleLowerCase; + +try { + var __instance = new __FACTORY; + throw new Test262Error('#1: var __FACTORY = String.prototype.toLocaleLowerCase; "__instance = new __FACTORY" lead to throwing exception'); +} catch (e) { + if ((e instanceof TypeError) !== true) { + throw new Test262Error('#1.1: var __FACTORY = String.prototype.toLocaleLowerCase; "var __instance = new __FACTORY" throw a TypeError. Actual: ' + (e)); + } +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A8.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A8.js new file mode 100644 index 0000000000..fc35b73e84 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A8.js @@ -0,0 +1,45 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + The String.prototype.toLocaleLowerCase.length property has the attribute + DontEnum +es5id: 15.5.4.17_A8 +description: > + Checking if enumerating the + String.prototype.toLocaleLowerCase.length property fails +---*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.toLocaleLowerCase.hasOwnProperty('length'))) { + throw new Test262Error('#0: String.prototype.toLocaleLowerCase.hasOwnProperty(\'length\') return true. Actual: ' + String.prototype.toLocaleLowerCase.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// CHECK#1 +if (String.prototype.toLocaleLowerCase.propertyIsEnumerable('length')) { + throw new Test262Error('#1: String.prototype.toLocaleLowerCase.propertyIsEnumerable(\'length\') return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// CHECK#2 +var count = 0; + +for (var p in String.prototype.toLocaleLowerCase) { + if (p === "length") count++; +} + +if (count !== 0) { + throw new Test262Error('#2: count=0; for (p in String.prototype.toLocaleLowerCase){if (p==="length") count++;}; count === 0. Actual: ' + count); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A9.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A9.js new file mode 100644 index 0000000000..3e03922bc8 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/S15.5.4.17_A9.js @@ -0,0 +1,38 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + The String.prototype.toLocaleLowerCase.length property does not have the + attribute DontDelete +es5id: 15.5.4.17_A9 +description: > + Checking if deleting the String.prototype.toLocaleLowerCase.length + property fails +---*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.toLocaleLowerCase.hasOwnProperty('length'))) { + throw new Test262Error('#0: String.prototype.toLocaleLowerCase.hasOwnProperty(\'length\') return true. Actual: ' + String.prototype.toLocaleLowerCase.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!delete String.prototype.toLocaleLowerCase.length) { + throw new Test262Error('#1: delete String.prototype.toLocaleLowerCase.length return true'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.toLocaleLowerCase.hasOwnProperty('length')) { + throw new Test262Error('#2: delete String.prototype.toLocaleLowerCase.length; String.prototype.toLocaleLowerCase.hasOwnProperty(\'length\') return false. Actual: ' + String.prototype.toLocaleLowerCase.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/browser.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/browser.js diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/name.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/name.js new file mode 100644 index 0000000000..0293ba687b --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/name.js @@ -0,0 +1,28 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 21.1.3.20 +description: > + String.prototype.toLocaleLowerCase.name is "toLocaleLowerCase". +info: | + String.prototype.toLocaleLowerCase ( [ reserved1 [ , reserved2 ] ] ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(String.prototype.toLocaleLowerCase.name, "toLocaleLowerCase"); + +verifyNotEnumerable(String.prototype.toLocaleLowerCase, "name"); +verifyNotWritable(String.prototype.toLocaleLowerCase, "name"); +verifyConfigurable(String.prototype.toLocaleLowerCase, "name"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/not-a-constructor.js new file mode 100644 index 0000000000..c6b26ea910 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/not-a-constructor.js @@ -0,0 +1,35 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.toLocaleLowerCase does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.toLocaleLowerCase), + false, + 'isConstructor(String.prototype.toLocaleLowerCase) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.toLocaleLowerCase(); +}, '`new String.prototype.toLocaleLowerCase()` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/shell.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/shell.js diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/special_casing.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/special_casing.js new file mode 100644 index 0000000000..43cfaa1a9e --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/special_casing.js @@ -0,0 +1,138 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Check if String.prototype.toLocaleLowerCase supports mappings defined in SpecialCasings +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). +es5id: 15.5.4.17 +es6id: 21.1.3.20 +---*/ + +// SpecialCasing.txt, except for conditional mappings. + +assert.sameValue("\u00DF".toLocaleLowerCase(), "\u00DF", "LATIN SMALL LETTER SHARP S"); + +// Locale-sensitive for Turkish and Azeri. +// assert.sameValue("\u0130".toLocaleLowerCase(), "\u0069\u0307", "LATIN CAPITAL LETTER I WITH DOT ABOVE"); + +assert.sameValue("\uFB00".toLocaleLowerCase(), "\uFB00", "LATIN SMALL LIGATURE FF"); +assert.sameValue("\uFB01".toLocaleLowerCase(), "\uFB01", "LATIN SMALL LIGATURE FI"); +assert.sameValue("\uFB02".toLocaleLowerCase(), "\uFB02", "LATIN SMALL LIGATURE FL"); +assert.sameValue("\uFB03".toLocaleLowerCase(), "\uFB03", "LATIN SMALL LIGATURE FFI"); +assert.sameValue("\uFB04".toLocaleLowerCase(), "\uFB04", "LATIN SMALL LIGATURE FFL"); +assert.sameValue("\uFB05".toLocaleLowerCase(), "\uFB05", "LATIN SMALL LIGATURE LONG S T"); +assert.sameValue("\uFB06".toLocaleLowerCase(), "\uFB06", "LATIN SMALL LIGATURE ST"); + +assert.sameValue("\u0587".toLocaleLowerCase(), "\u0587", "ARMENIAN SMALL LIGATURE ECH YIWN"); +assert.sameValue("\uFB13".toLocaleLowerCase(), "\uFB13", "ARMENIAN SMALL LIGATURE MEN NOW"); +assert.sameValue("\uFB14".toLocaleLowerCase(), "\uFB14", "ARMENIAN SMALL LIGATURE MEN ECH"); +assert.sameValue("\uFB15".toLocaleLowerCase(), "\uFB15", "ARMENIAN SMALL LIGATURE MEN INI"); +assert.sameValue("\uFB16".toLocaleLowerCase(), "\uFB16", "ARMENIAN SMALL LIGATURE VEW NOW"); +assert.sameValue("\uFB17".toLocaleLowerCase(), "\uFB17", "ARMENIAN SMALL LIGATURE MEN XEH"); + +assert.sameValue("\u0149".toLocaleLowerCase(), "\u0149", "LATIN SMALL LETTER N PRECEDED BY APOSTROPHE"); + +assert.sameValue("\u0390".toLocaleLowerCase(), "\u0390", "GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS"); +assert.sameValue("\u03B0".toLocaleLowerCase(), "\u03B0", "GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS"); + +assert.sameValue("\u01F0".toLocaleLowerCase(), "\u01F0", "LATIN SMALL LETTER J WITH CARON"); +assert.sameValue("\u1E96".toLocaleLowerCase(), "\u1E96", "LATIN SMALL LETTER H WITH LINE BELOW"); +assert.sameValue("\u1E97".toLocaleLowerCase(), "\u1E97", "LATIN SMALL LETTER T WITH DIAERESIS"); +assert.sameValue("\u1E98".toLocaleLowerCase(), "\u1E98", "LATIN SMALL LETTER W WITH RING ABOVE"); +assert.sameValue("\u1E99".toLocaleLowerCase(), "\u1E99", "LATIN SMALL LETTER Y WITH RING ABOVE"); +assert.sameValue("\u1E9A".toLocaleLowerCase(), "\u1E9A", "LATIN SMALL LETTER A WITH RIGHT HALF RING"); + +assert.sameValue("\u1F50".toLocaleLowerCase(), "\u1F50", "GREEK SMALL LETTER UPSILON WITH PSILI"); +assert.sameValue("\u1F52".toLocaleLowerCase(), "\u1F52", "GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA"); +assert.sameValue("\u1F54".toLocaleLowerCase(), "\u1F54", "GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA"); +assert.sameValue("\u1F56".toLocaleLowerCase(), "\u1F56", "GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI"); +assert.sameValue("\u1FB6".toLocaleLowerCase(), "\u1FB6", "GREEK SMALL LETTER ALPHA WITH PERISPOMENI"); +assert.sameValue("\u1FC6".toLocaleLowerCase(), "\u1FC6", "GREEK SMALL LETTER ETA WITH PERISPOMENI"); +assert.sameValue("\u1FD2".toLocaleLowerCase(), "\u1FD2", "GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA"); +assert.sameValue("\u1FD3".toLocaleLowerCase(), "\u1FD3", "GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA"); +assert.sameValue("\u1FD6".toLocaleLowerCase(), "\u1FD6", "GREEK SMALL LETTER IOTA WITH PERISPOMENI"); +assert.sameValue("\u1FD7".toLocaleLowerCase(), "\u1FD7", "GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI"); +assert.sameValue("\u1FE2".toLocaleLowerCase(), "\u1FE2", "GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA"); +assert.sameValue("\u1FE3".toLocaleLowerCase(), "\u1FE3", "GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA"); +assert.sameValue("\u1FE4".toLocaleLowerCase(), "\u1FE4", "GREEK SMALL LETTER RHO WITH PSILI"); +assert.sameValue("\u1FE6".toLocaleLowerCase(), "\u1FE6", "GREEK SMALL LETTER UPSILON WITH PERISPOMENI"); +assert.sameValue("\u1FE7".toLocaleLowerCase(), "\u1FE7", "GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI"); +assert.sameValue("\u1FF6".toLocaleLowerCase(), "\u1FF6", "GREEK SMALL LETTER OMEGA WITH PERISPOMENI"); + +assert.sameValue("\u1F80".toLocaleLowerCase(), "\u1F80", "GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI"); +assert.sameValue("\u1F81".toLocaleLowerCase(), "\u1F81", "GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI"); +assert.sameValue("\u1F82".toLocaleLowerCase(), "\u1F82", "GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI"); +assert.sameValue("\u1F83".toLocaleLowerCase(), "\u1F83", "GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI"); +assert.sameValue("\u1F84".toLocaleLowerCase(), "\u1F84", "GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI"); +assert.sameValue("\u1F85".toLocaleLowerCase(), "\u1F85", "GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI"); +assert.sameValue("\u1F86".toLocaleLowerCase(), "\u1F86", "GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI"); +assert.sameValue("\u1F87".toLocaleLowerCase(), "\u1F87", "GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI"); + +assert.sameValue("\u1F88".toLocaleLowerCase(), "\u1F80", "GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI"); +assert.sameValue("\u1F89".toLocaleLowerCase(), "\u1F81", "GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI"); +assert.sameValue("\u1F8A".toLocaleLowerCase(), "\u1F82", "GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI"); +assert.sameValue("\u1F8B".toLocaleLowerCase(), "\u1F83", "GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI"); +assert.sameValue("\u1F8C".toLocaleLowerCase(), "\u1F84", "GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI"); +assert.sameValue("\u1F8D".toLocaleLowerCase(), "\u1F85", "GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI"); +assert.sameValue("\u1F8E".toLocaleLowerCase(), "\u1F86", "GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI"); +assert.sameValue("\u1F8F".toLocaleLowerCase(), "\u1F87", "GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI"); + +assert.sameValue("\u1F90".toLocaleLowerCase(), "\u1F90", "GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI"); +assert.sameValue("\u1F91".toLocaleLowerCase(), "\u1F91", "GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI"); +assert.sameValue("\u1F92".toLocaleLowerCase(), "\u1F92", "GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI"); +assert.sameValue("\u1F93".toLocaleLowerCase(), "\u1F93", "GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI"); +assert.sameValue("\u1F94".toLocaleLowerCase(), "\u1F94", "GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI"); +assert.sameValue("\u1F95".toLocaleLowerCase(), "\u1F95", "GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI"); +assert.sameValue("\u1F96".toLocaleLowerCase(), "\u1F96", "GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI"); +assert.sameValue("\u1F97".toLocaleLowerCase(), "\u1F97", "GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI"); + +assert.sameValue("\u1F98".toLocaleLowerCase(), "\u1F90", "GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI"); +assert.sameValue("\u1F99".toLocaleLowerCase(), "\u1F91", "GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI"); +assert.sameValue("\u1F9A".toLocaleLowerCase(), "\u1F92", "GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI"); +assert.sameValue("\u1F9B".toLocaleLowerCase(), "\u1F93", "GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI"); +assert.sameValue("\u1F9C".toLocaleLowerCase(), "\u1F94", "GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI"); +assert.sameValue("\u1F9D".toLocaleLowerCase(), "\u1F95", "GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI"); +assert.sameValue("\u1F9E".toLocaleLowerCase(), "\u1F96", "GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI"); +assert.sameValue("\u1F9F".toLocaleLowerCase(), "\u1F97", "GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI"); + +assert.sameValue("\u1FA0".toLocaleLowerCase(), "\u1FA0", "GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI"); +assert.sameValue("\u1FA1".toLocaleLowerCase(), "\u1FA1", "GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI"); +assert.sameValue("\u1FA2".toLocaleLowerCase(), "\u1FA2", "GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI"); +assert.sameValue("\u1FA3".toLocaleLowerCase(), "\u1FA3", "GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI"); +assert.sameValue("\u1FA4".toLocaleLowerCase(), "\u1FA4", "GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI"); +assert.sameValue("\u1FA5".toLocaleLowerCase(), "\u1FA5", "GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI"); +assert.sameValue("\u1FA6".toLocaleLowerCase(), "\u1FA6", "GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI"); +assert.sameValue("\u1FA7".toLocaleLowerCase(), "\u1FA7", "GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI"); + +assert.sameValue("\u1FA8".toLocaleLowerCase(), "\u1FA0", "GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI"); +assert.sameValue("\u1FA9".toLocaleLowerCase(), "\u1FA1", "GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI"); +assert.sameValue("\u1FAA".toLocaleLowerCase(), "\u1FA2", "GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI"); +assert.sameValue("\u1FAB".toLocaleLowerCase(), "\u1FA3", "GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI"); +assert.sameValue("\u1FAC".toLocaleLowerCase(), "\u1FA4", "GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI"); +assert.sameValue("\u1FAD".toLocaleLowerCase(), "\u1FA5", "GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI"); +assert.sameValue("\u1FAE".toLocaleLowerCase(), "\u1FA6", "GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI"); +assert.sameValue("\u1FAF".toLocaleLowerCase(), "\u1FA7", "GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI"); + +assert.sameValue("\u1FB3".toLocaleLowerCase(), "\u1FB3", "GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI"); +assert.sameValue("\u1FBC".toLocaleLowerCase(), "\u1FB3", "GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI"); +assert.sameValue("\u1FC3".toLocaleLowerCase(), "\u1FC3", "GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI"); +assert.sameValue("\u1FCC".toLocaleLowerCase(), "\u1FC3", "GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI"); +assert.sameValue("\u1FF3".toLocaleLowerCase(), "\u1FF3", "GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI"); +assert.sameValue("\u1FFC".toLocaleLowerCase(), "\u1FF3", "GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI"); + +assert.sameValue("\u1FB2".toLocaleLowerCase(), "\u1FB2", "GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI"); +assert.sameValue("\u1FB4".toLocaleLowerCase(), "\u1FB4", "GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI"); +assert.sameValue("\u1FC2".toLocaleLowerCase(), "\u1FC2", "GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI"); +assert.sameValue("\u1FC4".toLocaleLowerCase(), "\u1FC4", "GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI"); +assert.sameValue("\u1FF2".toLocaleLowerCase(), "\u1FF2", "GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI"); +assert.sameValue("\u1FF4".toLocaleLowerCase(), "\u1FF4", "GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI"); + +assert.sameValue("\u1FB7".toLocaleLowerCase(), "\u1FB7", "GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI"); +assert.sameValue("\u1FC7".toLocaleLowerCase(), "\u1FC7", "GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI"); +assert.sameValue("\u1FF7".toLocaleLowerCase(), "\u1FF7", "GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/special_casing_conditional.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/special_casing_conditional.js new file mode 100644 index 0000000000..eaa101eeb9 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/special_casing_conditional.js @@ -0,0 +1,103 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Check if String.prototype.toLocaleLowerCase supports conditional mappings defined in SpecialCasings +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). +es5id: 15.5.4.17 +es6id: 21.1.3.20 +---*/ + +// 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 5.1, 3.13 Default Case Algorithms. + +assert.sameValue( + "\u03A3".toLocaleLowerCase(), + "\u03C3", + "Single GREEK CAPITAL LETTER SIGMA" +); + +// Sigma preceded by Cased and zero or more Case_Ignorable. +assert.sameValue( + "A\u03A3".toLocaleLowerCase(), + "a\u03C2", + "Sigma preceded by LATIN CAPITAL LETTER A" +); +assert.sameValue( + "\uD835\uDCA2\u03A3".toLocaleLowerCase(), + "\uD835\uDCA2\u03C2", + "Sigma preceded by MATHEMATICAL SCRIPT CAPITAL G (D835 DCA2 = 1D4A2)" +); +assert.sameValue( + "A.\u03A3".toLocaleLowerCase(), + "a.\u03C2", + "Sigma preceded by FULL STOP" +); +assert.sameValue( + "A\u00AD\u03A3".toLocaleLowerCase(), + "a\u00AD\u03C2", + "Sigma preceded by SOFT HYPHEN (00AD)" +); +assert.sameValue( + "A\uD834\uDE42\u03A3".toLocaleLowerCase(), + "a\uD834\uDE42\u03C2", + "Sigma preceded by COMBINING GREEK MUSICAL TRISEME (D834 DE42 = 1D242)" +); +assert.sameValue( + "\u0345\u03A3".toLocaleLowerCase(), + "\u0345\u03C3", + "Sigma preceded by COMBINING GREEK YPOGEGRAMMENI (0345)" +); +assert.sameValue( + "\u0391\u0345\u03A3".toLocaleLowerCase(), + "\u03B1\u0345\u03C2", + "Sigma preceded by GREEK CAPITAL LETTER ALPHA (0391), COMBINING GREEK YPOGEGRAMMENI (0345)" +); + +// Sigma not followed by zero or more Case_Ignorable and then Cased. +assert.sameValue( + "A\u03A3B".toLocaleLowerCase(), + "a\u03C3b", + "Sigma followed by LATIN CAPITAL LETTER B" +); +assert.sameValue( + "A\u03A3\uD835\uDCA2".toLocaleLowerCase(), + "a\u03C3\uD835\uDCA2", + "Sigma followed by MATHEMATICAL SCRIPT CAPITAL G (D835 DCA2 = 1D4A2)" +); +assert.sameValue( + "A\u03A3.b".toLocaleLowerCase(), + "a\u03C3.b", + "Sigma followed by FULL STOP" +); +assert.sameValue( + "A\u03A3\u00ADB".toLocaleLowerCase(), + "a\u03C3\u00ADb", + "Sigma followed by SOFT HYPHEN (00AD)" +); +assert.sameValue( + "A\u03A3\uD834\uDE42B".toLocaleLowerCase(), + "a\u03C3\uD834\uDE42b", + "Sigma followed by COMBINING GREEK MUSICAL TRISEME (D834 DE42 = 1D242)" +); +assert.sameValue( + "A\u03A3\u0345".toLocaleLowerCase(), + "a\u03C2\u0345", + "Sigma followed by COMBINING GREEK YPOGEGRAMMENI (0345)" +); +assert.sameValue( + "A\u03A3\u0345\u0391".toLocaleLowerCase(), + "a\u03C3\u0345\u03B1", + "Sigma followed by COMBINING GREEK YPOGEGRAMMENI (0345), GREEK CAPITAL LETTER ALPHA (0391)" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/supplementary_plane.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/supplementary_plane.js new file mode 100644 index 0000000000..0c5be957a4 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/supplementary_plane.js @@ -0,0 +1,66 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: String.prototype.toLocaleLowerCase() iterates over code points +info: | + 21.1.3.20 String.prototype.toLocaleLowerCase() + ... + This function interprets a String value as a sequence of UTF-16 encoded + code points, as described in 6.1.4. + + This function works exactly the same as toLowerCase [...]. + + 21.1.3.20 String.prototype.toLowerCase ( ) + + ... + 4. Let cpList be a List containing in order the code points as defined in + 6.1.4 of S, starting at the first element of S. + 5. For each code point c in cpList, if the Unicode Character Database + provides a language insensitive lower case equivalent of c then replace + c in cpList with that equivalent code point(s). +es6id: 21.1.3.20 +---*/ + +assert.sameValue("\uD801\uDC00".toLocaleLowerCase(), "\uD801\uDC28", "DESERET CAPITAL LETTER LONG I"); +assert.sameValue("\uD801\uDC01".toLocaleLowerCase(), "\uD801\uDC29", "DESERET CAPITAL LETTER LONG E"); +assert.sameValue("\uD801\uDC02".toLocaleLowerCase(), "\uD801\uDC2A", "DESERET CAPITAL LETTER LONG A"); +assert.sameValue("\uD801\uDC03".toLocaleLowerCase(), "\uD801\uDC2B", "DESERET CAPITAL LETTER LONG AH"); +assert.sameValue("\uD801\uDC04".toLocaleLowerCase(), "\uD801\uDC2C", "DESERET CAPITAL LETTER LONG O"); +assert.sameValue("\uD801\uDC05".toLocaleLowerCase(), "\uD801\uDC2D", "DESERET CAPITAL LETTER LONG OO"); +assert.sameValue("\uD801\uDC06".toLocaleLowerCase(), "\uD801\uDC2E", "DESERET CAPITAL LETTER SHORT I"); +assert.sameValue("\uD801\uDC07".toLocaleLowerCase(), "\uD801\uDC2F", "DESERET CAPITAL LETTER SHORT E"); +assert.sameValue("\uD801\uDC08".toLocaleLowerCase(), "\uD801\uDC30", "DESERET CAPITAL LETTER SHORT A"); +assert.sameValue("\uD801\uDC09".toLocaleLowerCase(), "\uD801\uDC31", "DESERET CAPITAL LETTER SHORT AH"); +assert.sameValue("\uD801\uDC0A".toLocaleLowerCase(), "\uD801\uDC32", "DESERET CAPITAL LETTER SHORT O"); +assert.sameValue("\uD801\uDC0B".toLocaleLowerCase(), "\uD801\uDC33", "DESERET CAPITAL LETTER SHORT OO"); +assert.sameValue("\uD801\uDC0C".toLocaleLowerCase(), "\uD801\uDC34", "DESERET CAPITAL LETTER AY"); +assert.sameValue("\uD801\uDC0D".toLocaleLowerCase(), "\uD801\uDC35", "DESERET CAPITAL LETTER OW"); +assert.sameValue("\uD801\uDC0E".toLocaleLowerCase(), "\uD801\uDC36", "DESERET CAPITAL LETTER WU"); +assert.sameValue("\uD801\uDC0F".toLocaleLowerCase(), "\uD801\uDC37", "DESERET CAPITAL LETTER YEE"); +assert.sameValue("\uD801\uDC10".toLocaleLowerCase(), "\uD801\uDC38", "DESERET CAPITAL LETTER H"); +assert.sameValue("\uD801\uDC11".toLocaleLowerCase(), "\uD801\uDC39", "DESERET CAPITAL LETTER PEE"); +assert.sameValue("\uD801\uDC12".toLocaleLowerCase(), "\uD801\uDC3A", "DESERET CAPITAL LETTER BEE"); +assert.sameValue("\uD801\uDC13".toLocaleLowerCase(), "\uD801\uDC3B", "DESERET CAPITAL LETTER TEE"); +assert.sameValue("\uD801\uDC14".toLocaleLowerCase(), "\uD801\uDC3C", "DESERET CAPITAL LETTER DEE"); +assert.sameValue("\uD801\uDC15".toLocaleLowerCase(), "\uD801\uDC3D", "DESERET CAPITAL LETTER CHEE"); +assert.sameValue("\uD801\uDC16".toLocaleLowerCase(), "\uD801\uDC3E", "DESERET CAPITAL LETTER JEE"); +assert.sameValue("\uD801\uDC17".toLocaleLowerCase(), "\uD801\uDC3F", "DESERET CAPITAL LETTER KAY"); +assert.sameValue("\uD801\uDC18".toLocaleLowerCase(), "\uD801\uDC40", "DESERET CAPITAL LETTER GAY"); +assert.sameValue("\uD801\uDC19".toLocaleLowerCase(), "\uD801\uDC41", "DESERET CAPITAL LETTER EF"); +assert.sameValue("\uD801\uDC1A".toLocaleLowerCase(), "\uD801\uDC42", "DESERET CAPITAL LETTER VEE"); +assert.sameValue("\uD801\uDC1B".toLocaleLowerCase(), "\uD801\uDC43", "DESERET CAPITAL LETTER ETH"); +assert.sameValue("\uD801\uDC1C".toLocaleLowerCase(), "\uD801\uDC44", "DESERET CAPITAL LETTER THEE"); +assert.sameValue("\uD801\uDC1D".toLocaleLowerCase(), "\uD801\uDC45", "DESERET CAPITAL LETTER ES"); +assert.sameValue("\uD801\uDC1E".toLocaleLowerCase(), "\uD801\uDC46", "DESERET CAPITAL LETTER ZEE"); +assert.sameValue("\uD801\uDC1F".toLocaleLowerCase(), "\uD801\uDC47", "DESERET CAPITAL LETTER ESH"); +assert.sameValue("\uD801\uDC20".toLocaleLowerCase(), "\uD801\uDC48", "DESERET CAPITAL LETTER ZHEE"); +assert.sameValue("\uD801\uDC21".toLocaleLowerCase(), "\uD801\uDC49", "DESERET CAPITAL LETTER ER"); +assert.sameValue("\uD801\uDC22".toLocaleLowerCase(), "\uD801\uDC4A", "DESERET CAPITAL LETTER EL"); +assert.sameValue("\uD801\uDC23".toLocaleLowerCase(), "\uD801\uDC4B", "DESERET CAPITAL LETTER EM"); +assert.sameValue("\uD801\uDC24".toLocaleLowerCase(), "\uD801\uDC4C", "DESERET CAPITAL LETTER EN"); +assert.sameValue("\uD801\uDC25".toLocaleLowerCase(), "\uD801\uDC4D", "DESERET CAPITAL LETTER ENG"); +assert.sameValue("\uD801\uDC26".toLocaleLowerCase(), "\uD801\uDC4E", "DESERET CAPITAL LETTER OI"); +assert.sameValue("\uD801\uDC27".toLocaleLowerCase(), "\uD801\uDC4F", "DESERET CAPITAL LETTER EW"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/this-value-not-obj-coercible.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/this-value-not-obj-coercible.js new file mode 100644 index 0000000000..9998f32056 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/this-value-not-obj-coercible.js @@ -0,0 +1,28 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.tolocalelowercase +description: The "this" value must be object-coercible +info: | + This function works exactly the same as toLowerCase except that its result is + intended to yield the correct result for the host environment's current + locale, rather than a locale-independent result. + + 21.1.3.24 String.prototype.toLowerCase + + 1. Let O be ? RequireObjectCoercible(this value). +---*/ + +var toLocaleLowerCase = String.prototype.toLocaleLowerCase; + +assert.sameValue(typeof toLocaleLowerCase, 'function'); + +assert.throws(TypeError, function() { + toLocaleLowerCase.call(undefined); +}, 'undefined'); + +assert.throws(TypeError, function() { + toLocaleLowerCase.call(null); +}, 'null'); + +reportCompare(0, 0); |