@@ -242,7 +242,7 @@ function updateModuleForToNestedModule(j, root) {
242242}
243243
244244function updateLookupCalls ( j , root ) {
245- return root
245+ root
246246 . find ( j . MemberExpression , {
247247 object : {
248248 object : { type : 'ThisExpression' } ,
@@ -256,6 +256,31 @@ function updateLookupCalls(j, root) {
256256 } ) ;
257257}
258258
259+ function updateRegisterCalls ( j , root ) {
260+ root
261+ . find ( j . MemberExpression , {
262+ object : {
263+ object : { type : 'ThisExpression' } ,
264+ property : { name : 'registry' } ,
265+ } ,
266+ property : { name : 'register' } ,
267+ } )
268+ . forEach ( path => {
269+ let thisDotOwner = j . memberExpression ( j . thisExpression ( ) , j . identifier ( 'owner' ) ) ;
270+ path . replace ( j . memberExpression ( thisDotOwner , path . value . property ) ) ;
271+ } ) ;
272+
273+ root
274+ . find ( j . MemberExpression , {
275+ object : { type : 'ThisExpression' } ,
276+ property : { name : 'register' } ,
277+ } )
278+ . forEach ( path => {
279+ let thisDotOwner = j . memberExpression ( j . thisExpression ( ) , j . identifier ( 'owner' ) ) ;
280+ path . replace ( j . memberExpression ( thisDotOwner , path . value . property ) ) ;
281+ } ) ;
282+ }
283+
259284module . exports = function ( file , api , options ) {
260285 const j = api . jscodeshift ;
261286
@@ -272,6 +297,7 @@ module.exports = function(file, api, options) {
272297 updateToNewEmberQUnitImports ( j , root ) ;
273298 updateModuleForToNestedModule ( j , root ) ;
274299 updateLookupCalls ( j , root ) ;
300+ updateRegisterCalls ( j , root ) ;
275301
276302 return root . toSource ( printOptions ) ;
277303} ;
0 commit comments