-
Notifications
You must be signed in to change notification settings - Fork 156
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
Force creation of a function in a loop? (unwanted optimiziation) #1079
Comments
Huh. That looks like a bug to me, or at the very least a completely undocumented gotcha. I can think of two workarounds, at least: change |
ye, okay, i've created some factory function outside of the loop for now.. |
well, i've got some answer from the JIT-man: "Different constructor functions will have different hidden classes" So my intent to make some set of "look-alike" constructors with the same hidden class won't work with this pattern. Maybe, it's not a bug, i see no reason to write such code constructs now.. |
Looks like very same issue: https://stackoverflow.com/a/41587540/1952991 |
@ceremcem yes yes, it's the same.. almost. |
Any update on this issue? |
Nobody's working on LiveScript in secret. What you see is what you get. |
Would you accept a patch that entirely removes that optimization? |
Short answer, I don't know if that's a good idea. It's been a few years since I've dug into LiveScript. If you've done the research and can make a logical case that the optimization doesn't help, I'd look at it. Given LiveScript's status as a legacy language I don't want to remove anything that some project might be relying on. |
Hi there,
I was assembling constructor functions in a map with similar code:
the output:
Is there a way to force creation (not definition) logic?
The text was updated successfully, but these errors were encountered: