Skip to content

Added tests for Array methods where length getter throws#4890

Open
G-Lee1031 wants to merge 1 commit intotc39:mainfrom
G-Lee1031:length-getter-throws
Open

Added tests for Array methods where length getter throws#4890
G-Lee1031 wants to merge 1 commit intotc39:mainfrom
G-Lee1031:length-getter-throws

Conversation

@G-Lee1031
Copy link
Contributor

Hello.
This PR adds test cases for Array.prototype.at, flat, and reverse to ensure they correctly propagate errors when the length getter throws. I have implemented these cases by using objects with length getters that throw a Test262Error.

Array.prototype.at

length-getter-throws.js: LengthOfArrayLike called in Array.prototype.at step 2 calls Get(_obj_, *"length"*).

Array.prototype.flat

length-getter-throws.js: LengthOfArrayLike called in Array.prototype.flat step 2 calls Get(_obj_, *"length"*).

Array.prototype.reverse

length-getter-throws.js: LengthOfArrayLike called in Array.prototype.reverse step 2 calls Get(_obj_, *"length"*).

I'm sorry if the duplicate filenames cause any confusion. My intention was to keep the structure consistent.

@G-Lee1031 G-Lee1031 requested a review from a team as a code owner January 27, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants