Browse Source

Forward `strong` parameter from `checkForWrites` to `checkForReads`.

contingency-plan
Oskar Segersvärd 10 years ago
parent
commit
49d6b295fa
  1. 8
      src/Statement.js

8
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;

Loading…
Cancel
Save