Skip to content

Commit 15b938e

Browse files
committed
[BUGFIX lts] Correct documentation for deprecation of EXTEND_PROTOTYPES
1 parent 0377da6 commit 15b938e

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,14 @@ export const ENV = {
2020
native object prototypes, a few extra methods in order to provide a more
2121
friendly API.
2222
23-
We generally recommend leaving this option set to true however, if you need
24-
to turn it off, you can add the configuration property
25-
`EXTEND_PROTOTYPES` to `EmberENV` and set it to `false`.
26-
27-
Note, when disabled (the default configuration for Ember Addons), you will
28-
instead have to access all methods and functions from the Ember
29-
namespace.
23+
The behavior from setting this option to `true` was deprecated in Ember 5.10.
3024
3125
@property EXTEND_PROTOTYPES
3226
@type Boolean
3327
@default true
3428
@for EmberENV
3529
@public
30+
@deprecated in v5.10
3631
*/
3732
EXTEND_PROTOTYPES: {
3833
Array: true,
@@ -201,6 +196,9 @@ export const ENV = {
201196
}
202197
}
203198

199+
// TODO: Remove in Ember 6.5. This setting code for EXTEND_PROTOTYPES
200+
// should stay for at least an LTS cycle so that users get the explicit
201+
// deprecation exception when it breaks in >= 6.0.0.
204202
let { EXTEND_PROTOTYPES } = EmberENV;
205203
if (EXTEND_PROTOTYPES !== undefined) {
206204
if (typeof EXTEND_PROTOTYPES === 'object' && EXTEND_PROTOTYPES !== null) {

packages/@ember/array/index.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,11 +1858,7 @@ const MutableArray = Mixin.create(EmberArray, MutableEnumerable, {
18581858

18591859
/**
18601860
Creates an `Ember.NativeArray` from an Array-like object.
1861-
Does not modify the original object's contents. `A()` is not needed if
1862-
`EmberENV.EXTEND_PROTOTYPES` is `true` (the default value). However,
1863-
it is recommended that you use `A()` when creating addons for
1864-
ember or when you can not guarantee that `EmberENV.EXTEND_PROTOTYPES`
1865-
will be `true`.
1861+
Does not modify the original object's contents.
18661862
18671863
Example
18681864
@@ -2061,10 +2057,7 @@ interface MutableArrayWithoutNative<T>
20612057

20622058
/**
20632059
The NativeArray mixin contains the properties needed to make the native
2064-
Array support MutableArray and all of its dependent APIs. Unless you
2065-
have `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Array` set to
2066-
false, this will be applied automatically. Otherwise you can apply the mixin
2067-
at anytime by calling `Ember.NativeArray.apply(Array.prototype)`.
2060+
Array support MutableArray and all of its dependent APIs.
20682061
20692062
@class Ember.NativeArray
20702063
@uses MutableArray

0 commit comments

Comments
 (0)