rename traverse stop method to skip and add a stop method that actually breaks the current traversal
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user