Browse Source

add all variable declarators (not split below top level)

better-aggressive
Rich-Harris 9 years ago
parent
commit
5024584f2d
  1. 5
      src/ast/attachScopes.js

5
src/ast/attachScopes.js

@ -20,8 +20,9 @@ export default function attachScopes ( statement ) {
// var foo = 1 // var foo = 1
if ( node.type === 'VariableDeclaration' ) { if ( node.type === 'VariableDeclaration' ) {
const isBlockDeclaration = blockDeclarations[ node.kind ]; const isBlockDeclaration = blockDeclarations[ node.kind ];
// only one declarator per block, because we split them up already node.declarations.forEach( declarator => {
scope.addDeclaration( node.declarations[0], isBlockDeclaration, true ); scope.addDeclaration( declarator, isBlockDeclaration, true );
});
} }
let newScope; let newScope;

Loading…
Cancel
Save