Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / String / prototype / toLocaleUpperCase / S15.5.4.19_A1_T9.js
blob644e10bd04d29553d02932ed6af66ad8054ebfd1
1 // Copyright 2009 the Sputnik authors.  All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 info: String.prototype.toLocaleUpperCase()
6 es5id: 15.5.4.19_A1_T9
7 description: Call toLocaleUpperCase() function of string object
8 ---*/
10 var __obj = {
11   valueOf: function() {},
12   toString: void 0
15 var __lowerCase = new String(__obj).toLocaleUpperCase();
17 var __expected = "UNDEFINED";
19 //////////////////////////////////////////////////////////////////////////////
20 //CHECK#1
21 if (__lowerCase.length !== __expected.length) {
22   throw new Test262Error('#1: __obj = {valueOf:function(){}, toString:void 0}; __lowerCase = new String(__obj).toLocaleUpperCase(); __expected ="UNDEFINED"; __lowerCase.length === __expected.length. Actual: ' + __lowerCase.length);
25 //////////////////////////////////////////////////////////////////////////////
27 //////////////////////////////////////////////////////////////////////////////
28 //CHECK#2
29 if (__lowerCase.index !== __expected.index) {
30   throw new Test262Error('#2: __obj = {valueOf:function(){}, toString:void 0}; __lowerCase = new String(__obj).toLocaleUpperCase(); __expected ="UNDEFINED"; __lowerCase.index === __expected.index. Actual: ' + __lowerCase.index);
33 //////////////////////////////////////////////////////////////////////////////
35 //////////////////////////////////////////////////////////////////////////////
36 //CHECK#3
37 if (__lowerCase.input !== __expected.input) {
38   throw new Test262Error('#3: __obj = {valueOf:function(){}, toString:void 0}; __lowerCase = new String(__obj).toLocaleUpperCase(); __expected ="UNDEFINED"; __lowerCase.input === __expected.input. Actual: ' + __lowerCase.input);
41 //////////////////////////////////////////////////////////////////////////////
43 //////////////////////////////////////////////////////////////////////////////
44 //CHECK#4
45 for (var index = 0; index < __expected.length; index++) {
46   if (__lowerCase[index] !== __expected[index]) {
47     throw new Test262Error('#4.' + index + ': __obj = {valueOf:function(){}, toString:void 0}; __lowerCase = new String(__obj).toLocaleUpperCase(); __expected ="UNDEFINED"; __lowerCase[' + index + ']===' + __expected[index] + '. Actual: ' + __lowerCase[index]);
48   }
51 //////////////////////////////////////////////////////////////////////////////
53 reportCompare(0, 0);