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
No more class chaining since 5.15.1 (class C extends class B extends class A) #1308
Comments
Classes aren't inlined anymore in some cases to prevent them being created multiple times and then being !== from themselves after a compilation (eg #1267). It's really tricky to analyze whether something will be executed multiple times (and specializing that for Extends), so I think this is a good trade-off for less scoping bugs, assuming it doesn't increase source code size a lot. |
@fabiosantoscode Thanks for the answer, only problem here is that if I try to put the result as text in a 'new Function(code)' |
Try returning the class you want the function to return. You'll need to add the bare_returns parse option so Terser doesn't think the |
Thanks, I missed the bare_returns option edit: realized I don't need that option since I do a regex check for exported es and replace it with a return etc https://github.com/ArteonToken/monorepo/blob/main/scripts/create-genesis.js#L13 Thanks for the time! edit2: so, realised something else 😅 shouldn't Terser remove that newline? |
Bug report or Feature request?
One of the two ^^
Version (complete output of
terser -V
or specific git commit)v5.15.1
Complete CLI command or
minify()
options usedterser
inputterser
output or errorExpected result
The text was updated successfully, but these errors were encountered: