Skip to content

test: add edge case coverage for Array.prototype.map#5178

Closed
ParthMozarkar wants to merge 5 commits intoboa-dev:mainfrom
ParthMozarkar:test-array-map-edge-cases
Closed

test: add edge case coverage for Array.prototype.map#5178
ParthMozarkar wants to merge 5 commits intoboa-dev:mainfrom
ParthMozarkar:test-array-map-edge-cases

Conversation

@ParthMozarkar
Copy link
Copy Markdown
Contributor

This PR adds additional test coverage for Array.prototype.map, focusing on important edge cases:

  • Empty arrays
  • Callback returning undefined
  • Sparse arrays (ensuring holes are preserved correctly)
  • Identity mapping behavior

The sparse array test explicitly verifies hole preservation using index checks, aligning with ECMAScript specification behavior.

These additions help improve conformance validation and reduce the risk of regressions in Array.prototype.map implementation.

This contributes to ongoing efforts to improve ECMAScript compliance in Boa.

@ParthMozarkar ParthMozarkar requested a review from a team as a code owner March 20, 2026 12:19
@github-actions github-actions bot added the Waiting On Review Waiting on reviews from the maintainers label Mar 20, 2026
@github-actions github-actions bot added this to the v1.0.0 milestone Mar 20, 2026
@github-actions github-actions bot added C-Tests Issues and PRs related to the tests. C-Builtins PRs and Issues related to builtins/intrinsics labels Mar 20, 2026
@ParthMozarkar
Copy link
Copy Markdown
Contributor Author

Hi! I’ve added a small test to improve edge case coverage for Array.prototype.map, focusing on sparse arrays and callback behavior.

Would love your feedback whenever you get time. Thanks!

Copy link
Copy Markdown
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't remove old tests...

@ParthMozarkar
Copy link
Copy Markdown
Contributor Author

Please don't remove old tests...

Thanks for the feedback! I’ve restored the existing tests and ensured this PR only adds new edge case coverage for Array.prototype.map without removing anything.

Happy to make further changes if needed.

@jedel1043
Copy link
Copy Markdown
Member

You didn't restore the old tests, you just adjusted the new tests...

@ParthMozarkar
Copy link
Copy Markdown
Contributor Author

ParthMozarkar commented Mar 20, 2026

You didn't restore the old tests, you just adjusted the new tests...

Okay...so sorry, i"ll make the new changes with the new commit !!

@jedel1043 jedel1043 added the A-Internal Changes that don't modify execution behaviour label Mar 20, 2026
@jedel1043 jedel1043 closed this Mar 20, 2026
@github-actions github-actions bot removed the Waiting On Review Waiting on reviews from the maintainers label Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Internal Changes that don't modify execution behaviour C-Builtins PRs and Issues related to builtins/intrinsics C-Tests Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants