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