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_T12.js
blob250b208e215a95e099b10c0a486350c9c17f92dc
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_T12
7 description: >
8     Override toString and valueOf functions, valueOf throw exception,
9     then call toLocaleUpperCase() function for this object
10 ---*/
12 var __obj = {
13   toString: function() {
14     return {};
15   },
16   valueOf: function() {
17     throw "intostr";
18   }
20 __obj.toLocaleUpperCase = String.prototype.toLocaleUpperCase;
21 //////////////////////////////////////////////////////////////////////////////
22 //CHECK#1
23 try {
24   var x = __obj.toLocaleUpperCase();
25   throw new Test262Error('#1: "var x = __obj.toLocaleUpperCase()" lead to throwing exception');
26 } catch (e) {
27   if (e !== "intostr") {
28     throw new Test262Error('#1.1: Exception === "intostr". Actual: ' + e);
29   }
32 //////////////////////////////////////////////////////////////////////////////
34 reportCompare(0, 0);