Skip to content

Commit 1e686b7

Browse files
committed
Move deprecation to avoid circular module imports
1 parent 18c65f2 commit 1e686b7

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

packages/@ember/-internals/deprecations/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,14 @@ export function deprecateUntil(message: string, deprecation: DeprecationObject)
154154
}
155155
deprecate(message, deprecation.test, options);
156156
}
157+
158+
const { EXTEND_PROTOTYPES } = ENV as {
159+
EXTEND_PROTOTYPES: { Array?: boolean };
160+
};
161+
162+
if (EXTEND_PROTOTYPES.Array !== false) {
163+
deprecateUntil(
164+
'Array prototype extensions are deprecated. Follow the deprecation guide for migration instructions, and set EmberENV.EXTEND_PROTOTYPES to false in your config/environment.js',
165+
DEPRECATIONS.DEPRECATE_ARRAY_PROTOTYPE_EXTENSIONS
166+
);
167+
}

packages/@ember/-internals/environment/lib/env.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { DEPRECATIONS, deprecateUntil } from '@ember/-internals/deprecations';
21
import { DEBUG } from '@glimmer/env';
32
import global from './global';
43

@@ -203,14 +202,6 @@ export const ENV = {
203202
}
204203

205204
let { EXTEND_PROTOTYPES } = EmberENV;
206-
207-
if (EXTEND_PROTOTYPES !== false) {
208-
deprecateUntil(
209-
'Array prototype extensions are deprecated. Follow the deprecation guide for migration instructions, and set EmberENV.EXTEND_PROTOTYPES to false in your config/environment.js',
210-
DEPRECATIONS.DEPRECATE_ARRAY_PROTOTYPE_EXTENSIONS
211-
);
212-
}
213-
214205
if (EXTEND_PROTOTYPES !== undefined) {
215206
if (typeof EXTEND_PROTOTYPES === 'object' && EXTEND_PROTOTYPES !== null) {
216207
ENV.EXTEND_PROTOTYPES.Array = EXTEND_PROTOTYPES.Array !== false;

0 commit comments

Comments
 (0)