From 49d6b295fa04836c73421bc056af5dcdacf8f18a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Segersv=C3=A4rd?= Date: Fri, 17 Jul 2015 11:08:26 +0200 Subject: [PATCH] Forward `strong` parameter from `checkForWrites` to `checkForReads`. --- src/Statement.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Statement.js b/src/Statement.js index be3d0e6..c9d98c0 100644 --- a/src/Statement.js +++ b/src/Statement.js @@ -134,7 +134,7 @@ export default class Statement { } this.checkForReads( scope, node, parent, !depth ); - this.checkForWrites( scope, node ); + this.checkForWrites( scope, node, !depth ); }, leave: ( node, parent ) => { if ( node._scope ) { @@ -174,7 +174,7 @@ export default class Statement { } } - checkForWrites ( scope, node ) { + checkForWrites ( scope, node, strong ) { const parent = node; const addNode = ( node, isAssignment ) => { @@ -183,14 +183,14 @@ export default class Statement { while ( node.type === 'MemberExpression' ) { // In a situation like that below, make sure the assignments - // depend on `a` and `b`. + // to arr depend on `a` and `b`. // // var a = 1, b = 0; // // arr[a] = arr[b] = true; // if ( node.computed ) { - this.checkForReads( scope, node.property, parent, true ); + this.checkForReads( scope, node.property, parent, strong ); } node = node.object;