Skip to content

Commit 17a8718

Browse files
authored
Merge pull request #20227 from emberjs/bugfix-ts-4.9
[BUGFIX release] Fix unsafe internal cast for NativeArray
2 parents c617784 + 04d3a88 commit 17a8718

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/@ember/array/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1958,7 +1958,7 @@ if (ENV.EXTEND_PROTOTYPES.Array) {
19581958

19591959
if (isEmberArray(arr)) {
19601960
// SAFETY: If it's a true native array and it is also an EmberArray then it should be an Ember NativeArray
1961-
return arr as NativeArray<T>;
1961+
return arr as unknown as NativeArray<T>;
19621962
} else {
19631963
// SAFETY: This will return an NativeArray but TS can't infer that.
19641964
return NativeArray.apply(arr ?? []) as NativeArray<T>;

packages/@ember/object/core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ class CoreObject {
261261

262262
/* globals Proxy Reflect */
263263
self = new Proxy(this, {
264-
get(target: CoreObject & HasUnknownProperty, property, receiver) {
264+
get(target: typeof this & HasUnknownProperty, property, receiver) {
265265
if (property === PROXY_CONTENT) {
266266
return target;
267267
} else if (

0 commit comments

Comments
 (0)