File tree Expand file tree Collapse file tree 4 files changed +34
-4
lines changed
fixtures/deprecate-expansion Expand file tree Collapse file tree 4 files changed +34
-4
lines changed Original file line number Diff line number Diff line change 1
1
( true && ! ( true ) && console . warn ( 'This is deprecated' ) ) ;
2
- ( true && ! ( false ) && console . warn ( 'Message without predicate' ) ) ;
2
+ ( true && ! ( false ) && console . warn ( 'Message without predicate' ) ) ;
3
+ ( true && ! ( true ) && console . warn ( 'This is deprecated with options' ) ) ;
4
+
5
+ function wrappedDeprecate ( ) {
6
+ ( true && ! ( true ) && console . warn ( 'This is also deprecated' ) ) ;
7
+ }
Original file line number Diff line number Diff line change 1
1
( true && ! ( true ) && console . warn ( 'This is deprecated' ) ) ;
2
- ( true && ! ( false ) && console . warn ( 'Message without predicate' ) ) ;
2
+ ( true && ! ( false ) && console . warn ( 'Message without predicate' ) ) ;
3
+ ( true && ! ( true ) && console . warn ( 'This is deprecated with options' ) ) ;
4
+
5
+ function wrappedDeprecate ( ) {
6
+ ( true && ! ( true ) && console . warn ( 'This is also deprecated' ) ) ;
7
+ }
Original file line number Diff line number Diff line change @@ -3,3 +3,15 @@ import { deprecate } from '@ember/debug-tools';
3
3
4
4
deprecate ( 'This is deprecated' , true ) ;
5
5
deprecate ( 'Message without predicate' ) ;
6
+ deprecate ( 'This is deprecated with options' , true , {
7
+ id : 'woot.options' ,
8
+ until : '3.0.0' ,
9
+ } ) ;
10
+ function wrappedDeprecate ( ) {
11
+ deprecate (
12
+ 'This is also deprecated' , true , {
13
+ "id" : "woot.wrapped" ,
14
+ "until" : "7.0.0" ,
15
+ }
16
+ ) ;
17
+ }
Original file line number Diff line number Diff line change @@ -157,11 +157,19 @@ module.exports = class Builder {
157
157
validate : ( expression , args ) => {
158
158
let meta = args [ 2 ] ;
159
159
160
- if ( meta && meta . properties && ! meta . properties . some ( prop => prop . key . name === 'id' ) ) {
160
+ if (
161
+ meta &&
162
+ meta . properties &&
163
+ ! meta . properties . some ( prop => prop . key . name === 'id' || prop . key . value === 'id' )
164
+ ) {
161
165
throw new ReferenceError ( `deprecate's meta information requires an "id" field.` ) ;
162
166
}
163
167
164
- if ( meta && meta . properties && ! meta . properties . some ( prop => prop . key . name === 'until' ) ) {
168
+ if (
169
+ meta &&
170
+ meta . properties &&
171
+ ! meta . properties . some ( prop => prop . key . name === 'until' || prop . key . value === 'until' )
172
+ ) {
165
173
throw new ReferenceError ( `deprecate's meta information requires an "until" field.` ) ;
166
174
}
167
175
} ,
You can’t perform that action at this time.
0 commit comments