Skip to content
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

Updated Record to return itself on no-op set call #795

Merged
merged 1 commit into from Feb 23, 2016
Merged

Updated Record to return itself on no-op set call #795

merged 1 commit into from Feb 23, 2016

Conversation

davidbonnet
Copy link
Contributor

Updated record tests
Fixes #558 and #536

@@ -78,6 +78,12 @@ export class Record extends KeyedCollection {
if (!this.has(k)) {
throw new Error('Cannot set unknown key "' + k + '" on ' + recordName(this));
}
if (this._map && !this._map.has(k)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be !this._map || !this._map.has(k) to also include the case where there is no map yet?

leebyron added a commit that referenced this pull request Feb 23, 2016
Updated `Record` to return itself on no-op `set` call
@leebyron leebyron merged commit 7360dfd into immutable-js:master Feb 23, 2016
@leebyron
Copy link
Collaborator

Actually this looks great. Thanks for this and also for including the tests!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants