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

fix: reset bili.config, add Map getter for DRAFT_STATE, make isEnumerable more resilient #351

Merged
merged 3 commits into from Apr 18, 2019

Conversation

aigoncharov
Copy link

No description provided.

src/common.js Outdated
@@ -109,7 +109,8 @@ export function each(value, cb) {
}

export function isEnumerable(base, prop) {
return Object.getOwnPropertyDescriptor(base, prop).enumerable
const descriptor = Object.getOwnPropertyDescriptor(base, prop)
return descriptor && descriptor.enumerable
Copy link
Member

Choose a reason for hiding this comment

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

Was this causing a crash? I don't think we ever pass a property that doesn't exist. Or is this just for posterity?

Copy link
Author

Choose a reason for hiding this comment

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

The descriptor is going to be undefined for Maps here https://github.com/immerjs/immer/blob/v3.1/src/immer.js#L288

@@ -185,6 +185,7 @@ const mapTraps = {
}
}
const mapGetters = {
[DRAFT_STATE]: state => state,
Copy link
Member

Choose a reason for hiding this comment

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

Ah, thanks for catching this!

Copy link
Author

Choose a reason for hiding this comment

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

Np. Thanks for refactoring the whole thing!

@aleclarson aleclarson merged commit a16976e into immerjs:v3.1 Apr 18, 2019
@aigoncharov aigoncharov deleted the v3.1 branch April 18, 2019 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants