mirror of
https://github.com/tc39/test262.git
synced 2025-07-27 07:54:41 +02:00
Add test for get access throwing
This commit is contained in:
parent
6cdb375d8c
commit
457185507e
31
test/built-ins/Array/prototype/group/get-throws.js
vendored
Normal file
31
test/built-ins/Array/prototype/group/get-throws.js
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
// Copyright (c) 2021 Ecma International. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-array.prototype.group
|
||||||
|
description: Array.prototype.group errors when accessing a getter throws.
|
||||||
|
info: |
|
||||||
|
22.1.3.14 Array.prototype.group ( callbackfn [ , thisArg ] )
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
6. Repeat, while k < len
|
||||||
|
a. Let Pk be ! ToString(𝔽(k)).
|
||||||
|
b. Let kValue be ? Get(O, Pk).
|
||||||
|
|
||||||
|
...
|
||||||
|
features: [array-grouping]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.throws(Test262Error, function() {
|
||||||
|
const arrayLike = Object.defineProperty({
|
||||||
|
length: 1,
|
||||||
|
}, '0', {
|
||||||
|
get: function() {
|
||||||
|
throw new Test262Error('no element for you');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Array.prototype.group.call(arrayLike, function() {
|
||||||
|
return 'key';
|
||||||
|
});
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user