|
|
@ -75,12 +75,10 @@ export class Scope {
|
|
|
|
if (node.kind === 'var' && this.block && this.parent) {
|
|
|
|
if (node.kind === 'var' && this.block && this.parent) {
|
|
|
|
this.parent.add_declaration(node);
|
|
|
|
this.parent.add_declaration(node);
|
|
|
|
} else if (node.type === 'VariableDeclaration') {
|
|
|
|
} else if (node.type === 'VariableDeclaration') {
|
|
|
|
const initialised = !!node.init;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
node.declarations.forEach((declarator: Node) => {
|
|
|
|
node.declarations.forEach((declarator: Node) => {
|
|
|
|
extract_names(declarator.id).forEach(name => {
|
|
|
|
extract_names(declarator.id).forEach(name => {
|
|
|
|
this.declarations.set(name, node);
|
|
|
|
this.declarations.set(name, node);
|
|
|
|
if (initialised) this.initialised_declarations.add(name);
|
|
|
|
if (declarator.init) this.initialised_declarations.add(name);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|