deopt on binding identifiers with same rest name - fixes #2091
This commit is contained in:
parent
507303456f
commit
57d2323ae9
@ -78,6 +78,18 @@ var memberExpressionOptimisationVisitor = {
|
||||
|
||||
state.references.push(this);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Deopt on use of a binding identifier with the same name as our rest param.
|
||||
*
|
||||
* See https://github.com/babel/babel/issues/2091
|
||||
*/
|
||||
|
||||
BindingIdentifier(node, parent, scope, state) {
|
||||
if (node.name === state.name) {
|
||||
state.deopted = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -0,0 +1 @@
|
||||
const deepAssign = (...args) => args = [];
|
||||
@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
var deepAssign = function deepAssign() {
|
||||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return args = [];
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user