File tree 2 files changed +24
-2
lines changed
2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change
1
+ import { deprecate } from '@ember/debug' ;
2
+
1
3
// STATE within a module is frowned upon, this exists
2
4
// to support Ember.STRINGS but shield ember internals from this legacy global
3
5
// API.
4
6
let STRINGS : { [ key : string ] : string } = { } ;
5
7
6
8
export function setStrings ( strings : { [ key : string ] : string } ) {
9
+ deprecateEmberStrings ( ) ;
7
10
STRINGS = strings ;
8
11
}
9
12
10
13
export function getStrings ( ) : { [ key : string ] : string } {
14
+ deprecateEmberStrings ( ) ;
11
15
return STRINGS ;
12
16
}
13
17
14
- export function getString ( name : string ) : string | undefined {
15
- return STRINGS [ name ] ;
18
+ function deprecateEmberStrings ( ) {
19
+ deprecate ( 'Ember.STRINGS is deprecated. It is no longer used by Ember.' , false , {
20
+ id : 'ember-strings' ,
21
+ for : 'ember-source' ,
22
+ since : {
23
+ available : '4.10' ,
24
+ enabled : '4.10.' ,
25
+ } ,
26
+ until : '5.0.0' ,
27
+ } ) ;
16
28
}
Original file line number Diff line number Diff line change @@ -67,6 +67,16 @@ moduleFor(
67
67
} ) ;
68
68
}
69
69
70
+ [ '@test Ember.STRINGS is deprecated' ] ( assert ) {
71
+ expectDeprecation ( ( ) => {
72
+ assert . ok ( Ember . STRINGS ) ;
73
+ } , 'Ember.STRINGS is deprecated. It is no longer used by Ember.' ) ;
74
+
75
+ expectDeprecation ( ( ) => {
76
+ Ember . STRINGS = { } ;
77
+ } , 'Ember.STRINGS is deprecated. It is no longer used by Ember.' ) ;
78
+ }
79
+
70
80
'@test Ember.FEATURES is exported' ( assert ) {
71
81
for ( let feature in FEATURES ) {
72
82
assert . equal (
You can’t perform that action at this time.
0 commit comments