Skip to content

Improve Type Safety & Reliability in EmberArray and MutableArray Implementations - #21012

Closed
wcr-karan wants to merge 1 commit into
emberjs:mainfrom
wcr-karan:main
Closed

wcr-karan wants to merge 1 commit into
emberjs:mainfrom
wcr-karan:main

Conversation

@wcr-karan

@wcr-karan wcr-karan commented Nov 25, 2025 •

Copy link
Copy Markdown

RESOLVED: #20778

Title

Refactor: Replace direct index access with objectAt for safer EmberArray iteration

Description

This PR updates internal array utilities to avoid unsafe direct index access during iteration.
All occurrences of array[index] have been replaced with objectAt() to ensure correct behavior with EmberArray, proxies, and observable arrays.

Files Updated

  • packages/@ember/array/index.ts
  • packages/@ember/-internals/metal/lib/observer.ts

Why

objectAt() guarantees consistent lookup across NativeArrays, EmberArrays, and proxy-backed collections, improving safety and preventing edge-case failures.

Summary

This change modernizes array access patterns, improves reliability, and aligns with existing Ember internal conventions.

@NullVoxPopuli

Copy link
Copy Markdown
Contributor

This pr has nothing to do with the linked issue, and mostly deletes important comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move us onto stable decorators

2 participants