Skip to content

Commit 18c65f2

Browse files
committed
Deprecate array prototype extensions
1 parent 199218e commit 18c65f2

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,16 @@ export const DEPRECATIONS = {
129129
enabled: '5.10.0',
130130
},
131131
}),
132+
DEPRECATE_ARRAY_PROTOTYPE_EXTENSIONS: deprecation({
133+
id: 'deprecate-array-prototype-extensions',
134+
url: 'https://deprecations.emberjs.com/id/deprecate-deprecate-array-prototype-extensions',
135+
until: '6.0.0',
136+
for: 'ember-source',
137+
since: {
138+
available: '5.10.0',
139+
enabled: '5.10.0',
140+
},
141+
}),
132142
};
133143

134144
export function deprecateUntil(message: string, deprecation: DeprecationObject) {

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

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

@@ -202,6 +203,14 @@ export const ENV = {
202203
}
203204

204205
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+
205214
if (EXTEND_PROTOTYPES !== undefined) {
206215
if (typeof EXTEND_PROTOTYPES === 'object' && EXTEND_PROTOTYPES !== null) {
207216
ENV.EXTEND_PROTOTYPES.Array = EXTEND_PROTOTYPES.Array !== false;

0 commit comments

Comments
 (0)