diff --git a/packages/@ember/-internals/deprecations/index.ts b/packages/@ember/-internals/deprecations/index.ts index 646093887c2..91a2f2510f4 100644 --- a/packages/@ember/-internals/deprecations/index.ts +++ b/packages/@ember/-internals/deprecations/index.ts @@ -154,3 +154,14 @@ export function deprecateUntil(message: string, deprecation: DeprecationObject) } deprecate(message, deprecation.test, options); } + +const { EXTEND_PROTOTYPES } = ENV as { + EXTEND_PROTOTYPES: { Array?: boolean }; +}; + +if (EXTEND_PROTOTYPES.Array !== false) { + deprecateUntil( + 'Array prototype extensions are deprecated. Follow the deprecation guide for migration instructions, and set EmberENV.EXTEND_PROTOTYPES to false in your config/environment.js', + DEPRECATIONS.DEPRECATE_ARRAY_PROTOTYPE_EXTENSIONS + ); +} diff --git a/packages/@ember/-internals/environment/lib/env.ts b/packages/@ember/-internals/environment/lib/env.ts index 6547cbe9e6d..ae161ca5a39 100644 --- a/packages/@ember/-internals/environment/lib/env.ts +++ b/packages/@ember/-internals/environment/lib/env.ts @@ -1,4 +1,3 @@ -import { DEPRECATIONS, deprecateUntil } from '@ember/-internals/deprecations'; import { DEBUG } from '@glimmer/env'; import global from './global'; @@ -203,14 +202,6 @@ export const ENV = { } let { EXTEND_PROTOTYPES } = EmberENV; - - if (EXTEND_PROTOTYPES !== false) { - deprecateUntil( - 'Array prototype extensions are deprecated. Follow the deprecation guide for migration instructions, and set EmberENV.EXTEND_PROTOTYPES to false in your config/environment.js', - DEPRECATIONS.DEPRECATE_ARRAY_PROTOTYPE_EXTENSIONS - ); - } - if (EXTEND_PROTOTYPES !== undefined) { if (typeof EXTEND_PROTOTYPES === 'object' && EXTEND_PROTOTYPES !== null) { ENV.EXTEND_PROTOTYPES.Array = EXTEND_PROTOTYPES.Array !== false;