1+ import { AjaxError , AjaxTimeoutError } from 'rxjs/ajax' ;
2+ import {
3+ ArgumentOutOfRangeError ,
4+ EmptyError ,
5+ NotFoundError ,
6+ ObjectUnsubscribedError ,
7+ SequenceError ,
8+ TimeoutError ,
9+ UnsubscriptionError
10+ } from 'rxjs' ;
11+
12+ it ( 'should deprecate error construction' , ( ) => {
13+ let error : Error ;
14+ error = new AjaxError ( 'message' , null ! , null ! ) ; // $ExpectDeprecation
15+ error = new ArgumentOutOfRangeError ( ) ; // $ExpectDeprecation
16+ error = new EmptyError ( ) ; // $ExpectDeprecation
17+ error = new NotFoundError ( 'message' ) ; // $ExpectDeprecation
18+ error = new ObjectUnsubscribedError ( ) ; // $ExpectDeprecation
19+ error = new SequenceError ( 'message' ) ; // $ExpectDeprecation
20+ error = new TimeoutError ( ) ; // $ExpectDeprecation
21+ error = new UnsubscriptionError ( [ ] ) ; // $ExpectDeprecation
22+ } ) ;
23+
24+ it ( 'should not deprecate instanceof use' , ( ) => {
25+ const error = new Error ( 'message' ) ;
26+ let b : boolean ;
27+ b = error instanceof AjaxError ; // $ExpectNoDeprecation
28+ b = error instanceof ArgumentOutOfRangeError ; // $ExpectNoDeprecation
29+ b = error instanceof EmptyError ; // $ExpectNoDeprecation
30+ b = error instanceof NotFoundError ; // $ExpectNoDeprecation
31+ b = error instanceof ObjectUnsubscribedError ; // $ExpectNoDeprecation
32+ b = error instanceof SequenceError ; // $ExpectNoDeprecation
33+ b = error instanceof TimeoutError ; // $ExpectNoDeprecation
34+ b = error instanceof UnsubscriptionError ; // $ExpectNoDeprecation
35+ } ) ;
0 commit comments