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(store): immutability check IE compatibility #1997

Merged
merged 1 commit into from
Jul 5, 2019

Conversation

jonrimmer
Copy link
Contributor

IE errors when attempting to access the caller property of a function,
so rearrange the freeze function to check for this first.

Fixes #1991

PR Checklist

Please check if your PR fulfills the following requirements:

This shouldn't change the logic, so I think it should be covered by the existing tests?

  • Documentation has been added / updated (for bug fixes / features)

PR Type

[x] Bugfix

What is the current behavior?

If a store state object contains a function, the immutability check's freeze function will fail in IE. This is a known issue that also affected ngrx-store-freeze for a while and necessitated switching to deep-freeze-strict

It looks like whoever wrote the freeze function referenced deep-freeze-strict's code but perhaps didn't realise why the check for certain properties on a function were there, and so rearranged things in a way that broke it.

Closes #1991

What is the new behavior?

The freeze function now delays accessing the property until after the check.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

IE errors when attempting to access the `caller` property of a function,
so rearrange the freeze function to check for this first.

Fixes ngrx#1991
@ngrxbot
Copy link
Collaborator

ngrxbot commented Jul 4, 2019

Preview docs changes for e6c10fd at https://previews.ngrx.io/pr1997-e6c10fd/

1 similar comment
@ngrxbot
Copy link
Collaborator

ngrxbot commented Jul 4, 2019

Preview docs changes for e6c10fd at https://previews.ngrx.io/pr1997-e6c10fd/

@brandonroberts brandonroberts merged commit 11c0864 into ngrx:master Jul 5, 2019
jordanpowell88 pushed a commit to jordanpowell88/platform that referenced this pull request Nov 14, 2019
IE errors when attempting to access the `caller` property of a function,
so rearrange the freeze function to check for this first.

Fixes ngrx#1991
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.

Immutability check reducer is not compatible with IE11
4 participants