@@ -7,7 +7,7 @@ import EmberError from '@ember/error';
7
7
import { assign } from '@ember/polyfills' ;
8
8
import { cancel , once , run , scheduleOnce } from '@ember/runloop' ;
9
9
import { DEBUG } from '@glimmer/env' ;
10
- import EmberLocation , { EmberLocation as IEmberLocation } from '../location/api ' ;
10
+ import { EmberLocation } from '../location/util ' ;
11
11
import { calculateCacheKey , extractRouteArgs , getActiveTargetName , resemblesURL } from '../utils' ;
12
12
import DSL from './dsl' ;
13
13
import Route , {
@@ -121,7 +121,7 @@ const { slice } = Array.prototype;
121
121
@public
122
122
*/
123
123
class EmberRouter extends EmberObject {
124
- location ! : string | IEmberLocation ;
124
+ location ! : string | EmberLocation ;
125
125
rootURL ! : string ;
126
126
_routerMicrolib ! : Router < Route > ;
127
127
@@ -546,7 +546,7 @@ class EmberRouter extends EmberObject {
546
546
547
547
generate ( name : string , ...args : any [ ] ) {
548
548
let url = this . _routerMicrolib . generate ( name , ...args ) ;
549
- return ( this . location as IEmberLocation ) . formatURL ( url ) ;
549
+ return ( this . location as EmberLocation ) . formatURL ( url ) ;
550
550
}
551
551
552
552
/**
@@ -667,17 +667,8 @@ class EmberRouter extends EmberObject {
667
667
668
668
if ( 'string' === typeof location && owner ) {
669
669
let resolvedLocation = owner . lookup ( `location:${ location } ` ) ;
670
-
671
- if ( resolvedLocation !== undefined ) {
672
- location = set ( this , 'location' , resolvedLocation ) ;
673
- } else {
674
- // Allow for deprecated registration of custom location API's
675
- let options = {
676
- implementation : location ,
677
- } ;
678
-
679
- location = set ( this , 'location' , EmberLocation . create ( options ) ) ;
680
- }
670
+ assert ( `Location factory with ${ location } name is not found` , resolvedLocation !== undefined ) ;
671
+ location = set ( this , 'location' , resolvedLocation ) ;
681
672
}
682
673
683
674
if ( location !== null && typeof location === 'object' ) {
0 commit comments