Backed out 3 changesets (bug 1892041) for causing failures on async-module-does-not...
[gecko.git] / js / src / tests / test262 / built-ins / String / prototype / at / return-abrupt-from-this.js
blob0dc4011fce26aa739c928a971425a36e91d24490
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 }, '`String.prototype.at.call(undefined)` throws TypeError');
20 assert.throws(TypeError, () => {
21   String.prototype.at.call(null);
22 }, '`String.prototype.at.call(null)` throws TypeError');
24 reportCompare(0, 0);