rename traverse stop method to skip and add a stop method that actually breaks the current traversal

This commit is contained in:
Sebastian McKenzie
2015-01-03 20:08:31 +11:00
parent 51f7e75d2e
commit d20ab0eb05
8 changed files with 114 additions and 23 deletions

View File

@@ -114,7 +114,7 @@ SystemFormatter.prototype.transform = function (ast) {
enter: function (node, parent, scope) {
if (t.isFunction(node)) {
// nothing inside is accessible
return this.stop();
return this.skip();
}
if (t.isVariableDeclaration(node)) {
@@ -159,7 +159,7 @@ SystemFormatter.prototype.transform = function (ast) {
// hoist up function declarations for circular references
traverse(block, {
enter: function (node) {
if (t.isFunction(node)) this.stop();
if (t.isFunction(node)) this.skip();
if (t.isFunctionDeclaration(node) || node._blockHoist) {
handlerBody.push(node);