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
The code https://github.com/immutable-js/immutable-js/blob/main/src/methods/merge.js#L27-L33 calls constructor without new. If the constructor is a class, it will throw this error.
constructor
new
Playground: https://immutable-js.com/play/#Y2xhc3MgTXlSZWNvcmQgZXh0ZW5kcyBSZWNvcmQoewogIC8vIGE6IDEKfSkge30KCnZhciBteVJlY29yZCA9IG5ldyBNeVJlY29yZCgpOwpteVJlY29yZC5tZXJnZSh7IGE6IDQgfSk7
Do not use the empty object as the parameter of Record.
Record
- class MyRecord extends Record({}) {} + class MyRecord extends Record({ a: 1 }) {}
The text was updated successfully, but these errors were encountered:
Thank you for your report and for the playground link, I will investigate that !
Sorry, something went wrong.
Thanks, this has been released in 5.1.2
Wow, what a quick fix!
Successfully merging a pull request may close this issue.
Root Cause
The code https://github.com/immutable-js/immutable-js/blob/main/src/methods/merge.js#L27-L33 calls
constructor
withoutnew
. If theconstructor
is a class, it will throw this error.Playground: https://immutable-js.com/play/#Y2xhc3MgTXlSZWNvcmQgZXh0ZW5kcyBSZWNvcmQoewogIC8vIGE6IDEKfSkge30KCnZhciBteVJlY29yZCA9IG5ldyBNeVJlY29yZCgpOwpteVJlY29yZC5tZXJnZSh7IGE6IDQgfSk7
Workaround
Do not use the empty object as the parameter of
Record
.The text was updated successfully, but these errors were encountered: