We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Consider the following exported function containing an anonymous class expression.
export function isConstructor(fn) { if (fn === null) return false; try { void class extends fn { }; } catch { return false; } return true; }
In the bundled version, the class expression is dropped, causing the function to always branch out of the catch block.
function isConstructor(fn) { if (fn === null) return false; try { } catch { return false; } return true; }
The only way I found to fix the issue is turning off treeshaking completely, which is not desirable.
isConstructor(true); // false isConstructor(isNaN); // false isConstructor(String); // true
isConstructor(true); // true isConstructor(isNaN); // true isConstructor(String); // true
The text was updated successfully, but these errors were encountered:
As a side-effect, #2892 should solve this issue as well without forcing a complicated deoptimization around super class definitions.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
How Do We Reproduce?
Consider the following exported function containing an anonymous class expression.
In the bundled version, the class expression is dropped, causing the function to always branch out of the catch block.
The only way I found to fix the issue is turning off treeshaking completely, which is not desirable.
Expected Behavior
Actual Behavior
The text was updated successfully, but these errors were encountered: