fix export of parameters when renaming the binding of exported functions - fixes #2753

This commit is contained in:
Sebastian McKenzie
2015-11-02 19:24:23 +00:00
parent 2bdc222c0b
commit d1d0ed901e
5 changed files with 41 additions and 2 deletions

View File

@@ -91,3 +91,21 @@ getBindingIdentifiers.keys = {
VariableDeclaration: ["declarations"],
VariableDeclarator: ["id"]
};
export function getOuterBindingIdentifiers(
node: Object,
duplicates?: boolean,
): Object {
if (t.isFunction(node)) {
let id = node.id;
if (id) {
return {
[id.name]: duplicates ? [id] : id
};
} else {
return {};
}
} else {
return getBindingIdentifiers(node, duplicates);
}
}