@@ -224,7 +224,7 @@ module.exports = {
224
224
) ;
225
225
}
226
226
227
- let currentProxyObject = null ;
227
+ let proxyObjects = [ ] ;
228
228
let currentClassWithUnknownPropertyMethod = null ;
229
229
230
230
let importedGetName ;
@@ -251,17 +251,17 @@ module.exports = {
251
251
} ,
252
252
253
253
'CallExpression:exit' ( node ) {
254
- if ( currentProxyObject === node ) {
255
- currentProxyObject = null ;
254
+ if ( proxyObjects . at ( - 1 ) === node ) {
255
+ proxyObjects . pop ( ) ;
256
256
}
257
257
if ( currentClassWithUnknownPropertyMethod === node ) {
258
258
currentClassWithUnknownPropertyMethod = null ;
259
259
}
260
260
} ,
261
261
262
262
'ClassDeclaration:exit' ( node ) {
263
- if ( currentProxyObject === node ) {
264
- currentProxyObject = null ;
263
+ if ( proxyObjects . at ( - 1 ) === node ) {
264
+ proxyObjects . pop ( ) ;
265
265
}
266
266
if ( currentClassWithUnknownPropertyMethod === node ) {
267
267
currentClassWithUnknownPropertyMethod = null ;
@@ -270,7 +270,7 @@ module.exports = {
270
270
271
271
ClassDeclaration ( node ) {
272
272
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.
274
274
}
275
275
if ( emberUtils . isEmberObjectImplementingUnknownProperty ( node , scopeManager ) ) {
276
276
currentClassWithUnknownPropertyMethod = node ; // Keep track of being inside an object implementing `unknownProperty`.
@@ -284,12 +284,12 @@ module.exports = {
284
284
// **************************
285
285
286
286
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.
288
288
}
289
289
if ( emberUtils . isEmberObjectImplementingUnknownProperty ( node , scopeManager ) ) {
290
290
currentClassWithUnknownPropertyMethod = node ;
291
291
}
292
- if ( currentProxyObject || currentClassWithUnknownPropertyMethod ) {
292
+ if ( proxyObjects . at ( - 1 ) || currentClassWithUnknownPropertyMethod ) {
293
293
// Proxy objects and objects implementing `unknownProperty()`
294
294
// still require using `get()`, so ignore any code inside them.
295
295
return ;
0 commit comments