Skip to content
This repository was archived by the owner on Feb 12, 2022. It is now read-only.

wrong warning: side-effects from mutating the binding #2393

Closed
NTillmann opened this issue Aug 6, 2018 · 2 comments
Closed

wrong warning: side-effects from mutating the binding #2393

NTillmann opened this issue Aug 6, 2018 · 2 comments

Comments

@NTillmann
Copy link
Contributor

Prepacking this program...

(function() {
  function fn(arg) {
    if (arg) return undefined;
    let f = 42;
    return f;
  }
  __optimize(fn);
})();

gives the following warning:

side-effects from mutating the binding "f" at location: 4:12 - 4:4

Why?

@NTillmann NTillmann added the bug label Aug 6, 2018
@trueadm
Copy link
Contributor

trueadm commented Aug 6, 2018

Looks like an ES6 feature bug. Do we have a tag for ES6 features?

@NTillmann NTillmann added the ES6 label Aug 6, 2018
@NTillmann
Copy link
Contributor Author

Yes, we do :-) Not sure if it's just ES6 related. The warning goes away when I remove the if statement.

facebook-github-bot pushed a commit that referenced this issue Aug 15, 2018
Summary:
Fixes #2151 #2222 #2279 #2393 #2399 #2404 #2411 #2414 #2415
Added a fuzz testing tool
Added test cases
Turn crash in JSON.stringify into a diagnostic
Adds a `arrayNestedOptimizedFunctionsEnabled` flag to enable nested optimized functions derived from Array.prototype methods (like `map`) and Array.from
Refactor assignment on partial or possibly deleted property
Rewrote the joining logic to always do a full join at every join point
Removed last remnants of delayUnsupportedRequires

Reviewed By: cblappert

Differential Revision: D9349841

fbshipit-source-id: 74a16dbb015777d59d23fdfde77abbe2489c292a
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants