mirror of https://github.com/tc39/test262.git
Test non-property key throws
This commit is contained in:
parent
457185507e
commit
95f869ce0d
|
@ -0,0 +1,28 @@
|
|||
// 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() {
|
||||
return {
|
||||
toString() {
|
||||
throw new Test262Error('not a property key');
|
||||
}
|
||||
};
|
||||
})
|
||||
});
|
Loading…
Reference in New Issue