Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / String / prototype / at / return-abrupt-from-this.js
blobf9222d733e1d6b3b04aa86f614e8b390305ab5dd
1 // Copyright (C) 2020 Rick Waldron. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-string.prototype.at
5 description: >
6   Return abrupt from RequireObjectCoercible(this value).
7 info: |
8   String.prototype.at( index )
10   Let O be ? RequireObjectCoercible(this value).
12 features: [String.prototype.at]
13 ---*/
14 assert.sameValue(typeof String.prototype.at, 'function');
16 assert.throws(TypeError, () => {
17   String.prototype.at.call(undefined);
18 });
20 assert.throws(TypeError, () => {
21   String.prototype.at.call(null);
22 });
24 reportCompare(0, 0);