-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expanded array loses variable reference #4
Comments
Ah yes ... this is a current limitation, destructuring of the values in the callback is not supported with the aggressive inliner, and that should be checked against. I'll update. |
Alright I just coupled this fix with the release of const _iterable = [];
const _fn = ([a, b]) => {
console.log(a, b);
};
let _result = [];
for (let _key = 0, _length = _iterable.length, _value; _key < _length; ++_key) {
_value = _iterable[_key];
_result[_key] = _fn(_value, _key, _iterable);
}
_result; Thanks for the issue with the precise repro, made this an easy bug to squash. If anything else comes up, let me know! |
I am thinking if this is the best solution. This had a slight performance disadvantage. It would be nice to have a configurable warning about this. When warning is enabled, then it should suggest to use alternative syntax without destructuring to avoid the penalty of function invocation. Perhaps this would be better as an ESLint rule, though. |
This has actually been upgraded as of That said, your callout of providing a warning in the (now rare) bailout scenario is a good one. I'll make a note to add that in very soon. |
becomes:
a
andb
areundefined
.The text was updated successfully, but these errors were encountered: