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
Hello. Thanks for seamless. It's a very nice piece of software.
I was surprised however that I cannot create immutable object from an object without prototype (e.g. acquired with Object.create(null):
Object.create(null)
Immutable(Object.create(null)); // TypeError: target.hasOwnProperty is not a function
It is also impossible to merge such an object into immutable:
immutable
var o1 = Immutable({a: 1}); var o2 = Object.create(null); o2.b = 2; o1.merge(o2); // TypeError: other.hasOwnProperty is not a function
Obviously it depends on hasOwnProperty method of the original object, which is usually available in a prototype chain.
hasOwnProperty
Can we use global Object methods instead, like Object.getOwnPropertyDescriptor? I'll be happy to provide PR, but would like to discuss it first.
Object
Object.getOwnPropertyDescriptor
The text was updated successfully, but these errors were encountered:
I'm surprised by this too! Assuming it wouldn't have noticeable performance costs, I'd be happy to accept a PR that fixed this.
Sorry, something went wrong.
361eb4b
No branches or pull requests
Hello. Thanks for seamless. It's a very nice piece of software.
I was surprised however that I cannot create immutable object from an object without prototype (e.g. acquired with
Object.create(null)
:It is also impossible to merge such an object into
immutable
:Obviously it depends on
hasOwnProperty
method of the original object, which is usually available in a prototype chain.Can we use global
Object
methods instead, likeObject.getOwnPropertyDescriptor
? I'll be happy to provide PR, but would like to discuss it first.The text was updated successfully, but these errors were encountered: