Skip to content

Commit

Permalink
Merge pull request #20227 from emberjs/bugfix-ts-4.9
Browse files Browse the repository at this point in the history
[BUGFIX release] Fix unsafe internal cast for NativeArray
  • Loading branch information
chriskrycho authored Oct 18, 2022
2 parents c617784 + 04d3a88 commit 17a8718
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/@ember/array/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1958,7 +1958,7 @@ if (ENV.EXTEND_PROTOTYPES.Array) {

if (isEmberArray(arr)) {
// SAFETY: If it's a true native array and it is also an EmberArray then it should be an Ember NativeArray
return arr as NativeArray<T>;
return arr as unknown as NativeArray<T>;
} else {
// SAFETY: This will return an NativeArray but TS can't infer that.
return NativeArray.apply(arr ?? []) as NativeArray<T>;
Expand Down
2 changes: 1 addition & 1 deletion packages/@ember/object/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ class CoreObject {

/* globals Proxy Reflect */
self = new Proxy(this, {
get(target: CoreObject & HasUnknownProperty, property, receiver) {
get(target: typeof this & HasUnknownProperty, property, receiver) {
if (property === PROXY_CONTENT) {
return target;
} else if (
Expand Down

0 comments on commit 17a8718

Please sign in to comment.