don't touch function name containers when remapping modules - fixes #1160

This commit is contained in:
Sebastian McKenzie
2015-04-08 08:52:53 -07:00
parent d114349890
commit c12c4a5c39
9 changed files with 139 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ var wrap = function (state, method, id, scope) {
FUNCTION_ID: id,
FUNCTION_KEY: scope.generateUidIdentifier(id.name)
});
template.callee._skipModulesRemap = true;
// shim in dummy params to retain function arity, if you try to read the
// source then you'll get the original since it's proxied so it's all good

View File

@@ -46,6 +46,10 @@ var remapVisitor = {
}
}
if (node._skipModulesRemap) {
return this.skip();
}
if (t.isAssignmentExpression(node) && !node._ignoreModulesRemap) {
var exported = formatter.getExport(node.left, scope);
if (exported) {