Avoid re-traversing inserted references to the namespace binding. (#7418)

This commit is contained in:
Logan Smyth 2018-02-22 23:54:29 -08:00 committed by GitHub
parent 70627ac92c
commit 62c1046249
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 0 deletions

View File

@ -202,6 +202,10 @@ const rewriteReferencesVisitor = {
}
requeueInParent(path);
// The path could have been replaced with an identifier that would
// otherwise be re-visited, so we skip processing its children.
path.skip();
}
},

View File

@ -0,0 +1,5 @@
import * as mod from "mod";
import { named } from "mod";
named;
mod;

View File

@ -0,0 +1,6 @@
{
"plugins": [
["transform-modules-commonjs", {"lazy": true}],
"external-helpers"
]
}

View File

@ -0,0 +1,14 @@
"use strict";
function mod() {
const data = babelHelpers.interopRequireWildcard(require("mod"));
mod = function () {
return data;
};
return data;
}
mod().named;
mod();