@@ -224,7 +224,7 @@ module.exports = {
224224 ) ;
225225 }
226226
227- let currentProxyObject = null ;
227+ let proxyObjects = [ ] ;
228228 let currentClassWithUnknownPropertyMethod = null ;
229229
230230 let importedGetName ;
@@ -251,17 +251,17 @@ module.exports = {
251251 } ,
252252
253253 'CallExpression:exit' ( node ) {
254- if ( currentProxyObject === node ) {
255- currentProxyObject = null ;
254+ if ( proxyObjects . at ( - 1 ) === node ) {
255+ proxyObjects . pop ( ) ;
256256 }
257257 if ( currentClassWithUnknownPropertyMethod === node ) {
258258 currentClassWithUnknownPropertyMethod = null ;
259259 }
260260 } ,
261261
262262 'ClassDeclaration:exit' ( node ) {
263- if ( currentProxyObject === node ) {
264- currentProxyObject = null ;
263+ if ( proxyObjects . at ( - 1 ) === node ) {
264+ proxyObjects . pop ( ) ;
265265 }
266266 if ( currentClassWithUnknownPropertyMethod === node ) {
267267 currentClassWithUnknownPropertyMethod = null ;
@@ -270,7 +270,7 @@ module.exports = {
270270
271271 ClassDeclaration ( node ) {
272272 if ( emberUtils . isEmberProxy ( context , node ) ) {
273- currentProxyObject = node ; // Keep track of being inside a proxy object.
273+ proxyObjects . push ( node ) ; // Keep track of being inside a proxy object.
274274 }
275275 if ( emberUtils . isEmberObjectImplementingUnknownProperty ( node , scopeManager ) ) {
276276 currentClassWithUnknownPropertyMethod = node ; // Keep track of being inside an object implementing `unknownProperty`.
@@ -284,12 +284,12 @@ module.exports = {
284284 // **************************
285285
286286 if ( emberUtils . isEmberProxy ( context , node ) ) {
287- currentProxyObject = node ; // Keep track of being inside a proxy object.
287+ proxyObjects . push ( node ) ; // Keep track of being inside a proxy object.
288288 }
289289 if ( emberUtils . isEmberObjectImplementingUnknownProperty ( node , scopeManager ) ) {
290290 currentClassWithUnknownPropertyMethod = node ;
291291 }
292- if ( currentProxyObject || currentClassWithUnknownPropertyMethod ) {
292+ if ( proxyObjects . at ( - 1 ) || currentClassWithUnknownPropertyMethod ) {
293293 // Proxy objects and objects implementing `unknownProperty()`
294294 // still require using `get()`, so ignore any code inside them.
295295 return ;
0 commit comments