mirror of
https://github.com/tc39/test262.git
synced 2025-07-25 23:14:47 +02:00
Test callback throwing
This commit is contained in:
parent
95f869ce0d
commit
e7af14502e
24
test/built-ins/Array/prototype/group/callback-throws.js
vendored
Normal file
24
test/built-ins/Array/prototype/group/callback-throws.js
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
// 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 return value cannot be converted to a property key.
|
||||||
|
info: |
|
||||||
|
22.1.3.14 Array.prototype.group ( callbackfn [ , thisArg ] )
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
6. Repeat, while k < len
|
||||||
|
c. Let propertyKey be ? ToPropertyKey(? Call(callbackfn, thisArg, « kValue, 𝔽(k), O »)).
|
||||||
|
|
||||||
|
...
|
||||||
|
features: [array-grouping]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.throws(Test262Error, function() {
|
||||||
|
const array = [1];
|
||||||
|
array.group(function() {
|
||||||
|
throw new Test262Error('throw in callback');
|
||||||
|
})
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user