fix a catch param property identifier incorrectly being replaced when exploding statements in generators - fixes #301
This commit is contained in:
@@ -297,7 +297,8 @@ exports.TryStatement = function (path, stmt) {
|
||||
|
||||
types.visit(bodyPath, {
|
||||
visitIdentifier: function (path) {
|
||||
if (path.value.name === catchParamName &&
|
||||
if (t.isReferenced(path.value, path.parentPath.node) &&
|
||||
path.value.name === catchParamName &&
|
||||
path.scope.lookup(catchParamName) === catchScope) {
|
||||
return safeParam;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user