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

prepack fails when a switch statement has duplicate expressions in case clauses #1645

Closed
a8m opened this issue Mar 23, 2018 · 2 comments
Closed

Comments

@a8m
Copy link
Contributor

a8m commented Mar 23, 2018

Code example:

switch (Math.floor(Math.random() * 10)) {
  case 1:console.log('1'); break;
  case 1:console.log('1'); break;
  default: console.log('other');
}

Output:

Invariant Violation: pushing false
This is likely a bug in Prepack, not your code. Feel free to open an issue on GitHub.
....

Link to prepack-repl

@NTillmann
Copy link
Contributor

To address this...

  1. A test in test/serializer/abstract should be created, similar to other tests in that directory.
  2. The root cause of the issue needs to be addressed.

a8m added a commit that referenced this issue Mar 29, 2018
a8m added a commit that referenced this issue Mar 30, 2018
a8m added a commit that referenced this issue Mar 30, 2018
facebook-github-bot pushed a commit that referenced this issue Mar 30, 2018
Summary:
Issue #1645
Closes #1681

Differential Revision: D7461828

Pulled By: a8m

fbshipit-source-id: b37a6d15147b277950d50e91ae17a6825fba8b32
@a8m
Copy link
Contributor Author

a8m commented Mar 31, 2018

Closed via #1681

@a8m a8m closed this as completed Mar 31, 2018
facebook-github-bot pushed a commit that referenced this issue Apr 3, 2018
Summary:
Weekly release 0.2.30:
- Several improvements to simplifier, including more aggressive simplification of !e expressions, and better simplification in the presence of == and !=
- For npm/yarn, `prepack` command renamed to `prepack-cli`
- Many refactorings and bug fixes, including #1645, #1675, #1558, #1665 (crash in REPL on http://prepack.io), #1627 (Stop generator entries from being serialized twice), #1598

Reviewed By: hermanventer

Differential Revision: D7488673

fbshipit-source-id: c76ef9a745634abcdbe08b0a9ac9ff9d7c27fc85
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