This repository was archived by the owner on Apr 6, 2021. It is now read-only.

Description
Just a tweak to the example.
ast.traverseTopDown(
'VarDecl(x)',
function(b) {
declared[b.x.value] = true;
},
'VarDeclInit(x, _)',
function(b) {
declared[b.x.value] = true;
},
'FArg(x)',
function(b) {
declared[b.x.value] = true;
},
'Var(x)',
function(b) {
if (!declared[b.x.value]) {
log("Variable " + b.x.value + " is not declared.");
}
}
);
And requesting that acorn be updated (with a link to the commit that you're modifying somewhere before modification to make it easier to track down just what changes you're doing for future updates). Acorn now handles ECMA 3-6 where 0.4.1 didn't.
Great program, looking forward to working on it.