Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions test/built-ins/Array/from/from-throws-construct.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (C) 2026 Garham Lee. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-array.from
description: >
Array.from throws in construct operation.
info: |
Array.from ( _items_ [ , _mapper_ [ , _thisArg_ ] ] )

1. Let _C_ be the *this* value.

7. Let _arrayLike_ be ! ToObject(_items_).
8. Let _len_ be ? LengthOfArrayLike(_arrayLike_).
9. If IsConstructor(_C_) is *true*, then
a. Let _A_ be ? Construct(_C_, « 𝔽(_len_) »).
---*/
assert.throws(Test262Error, function () {
Array.from.call(function() {throw new Test262Error}, 0);
}, "Array.from throws")
Loading