Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / String / prototype / toLocaleUpperCase / this-value-not-obj-coercible.js
blobf3e29777923a5a4aa78d35be98f489a243437c11
1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-string.prototype.tolocaleuppercase
5 description: The "this" value must be object-coercible
6 info: |
7   This function works exactly the same as toUpperCase except that its result is
8   intended to yield the correct result for the host environment's current
9   locale, rather than a locale-independent result.
11   21.1.3.26 String.prototype.toUpperCase
13   This function behaves in exactly the same way as
14   String.prototype.toLowerCase, except that code points are mapped to their
15   uppercase equivalents as specified in the Unicode Character Database.
17   21.1.3.24 String.prototype.toLowerCase
19   1. Let O be ? RequireObjectCoercible(this value).
20 ---*/
22 var toLocaleUpperCase = String.prototype.toLocaleUpperCase;
24 assert.sameValue(typeof toLocaleUpperCase, 'function');
26 assert.throws(TypeError, function() {
27   toLocaleUpperCase.call(undefined);
28 }, 'undefined');
30 assert.throws(TypeError, function() {
31   toLocaleUpperCase.call(null);
32 }, 'null');
34 reportCompare(0, 0);