From 33a7c9fc24187e10299dcc0d2378dcdb93887ac7 Mon Sep 17 00:00:00 2001 From: Forbes Lindesay Date: Tue, 13 Jan 2015 11:10:28 +0000 Subject: [PATCH] Support import and export declarations in acorn/util/walk --- util/walk.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/util/walk.js b/util/walk.js index 117f56f93c..da7ca9f7e1 100644 --- a/util/walk.js +++ b/util/walk.js @@ -285,7 +285,15 @@ c(node.object, st, "Expression"); if (node.computed) c(node.property, st, "Expression"); }; - base.Identifier = base.Literal = base.ExportDeclaration = base.ImportDeclaration = ignore; + base.ExportDeclaration = function (node, st, c) { + c(node.declaration, st); + }; + base.ImportDeclaration = function (node, st, c) { + node.specifiers.forEach(function (specifier) { + c(specifier, st); + }); + }; + base.ImportSpecifier = base.ImportBatchSpecifier = base.Identifier = base.Literal = ignore; base.TaggedTemplateExpression = function(node, st, c) { c(node.tag, st, "Expression");