function scan_for_declared_refs (node, parent) {
    switch (node.type) {
    case 'FunctionDeclaration':
    case 'FunctionExpression':
    case 'CatchClause':
      if (node.type === 'FunctionDeclaration') cur_scope[node.id.name] = true;
      cur_scope = Object.create(cur_scope);
      cur_scope.__catchClause__ = node.type === 'CatchClause';
      scopes.push(cur_scope);
      node.scope = cur_scope;
      break;
    case 'VariableDeclarator':
      cur_scope[node.id.name] = true;
      if (cur_scope.__catchClause__) {
        scopes[scopes.indexOf(cur_scope) - 1][node.id.name] = true;
      }
    }
  }
// Attach 'var' and 'function' declaration names to their respective scopes.
Attach 'var' and 'function' declaration names to their respective scopes.
Attach ' var ' and ' function ' declaration names to their respective scopes .
function scan_for_declared_refs (node, parent) {
    switch (node.type) {
    case 'FunctionDeclaration':
    case 'FunctionExpression':
    case 'CatchClause':
      if (node.type === 'FunctionDeclaration') cur_scope[node.id.name] = true;
      cur_scope = Object.create(cur_scope);
      cur_scope.__catchClause__ = node.type === 'CatchClause';
      scopes.push(cur_scope);
      node.scope = cur_scope;
      break;
    case 'VariableDeclarator':
      cur_scope[node.id.name] = true;
      if (cur_scope.__catchClause__) {
        scopes[scopes.indexOf(cur_scope) - 1][node.id.name] = true;
      }
    }
  }
function scan_for_declared_refs ( node , parent ) { switch ( node . type ) { case 'FunctionDeclaration' : case 'FunctionExpression' : case 'CatchClause' : if ( node . type === 'FunctionDeclaration' ) cur_scope [ node . id . name ] = true ; cur_scope = Object . create ( cur_scope ) ; cur_scope . __catchClause__ = node . type === 'CatchClause' ; scopes . push ( cur_scope ) ; node . scope = cur_scope ; break ; case 'VariableDeclarator' : cur_scope [ node . id . name ] = true ; if ( cur_scope . __catchClause__ ) { scopes [ scopes . indexOf ( cur_scope ) - 1 ] [ node . id . name ] = true ; } } }
Attach 'var' and 'function' declaration names to their respective scopes.
Attach ' var ' and ' function ' declaration names to their respective scopes .