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

Method visitPropertiesOrArrayEntries is doing unnecessary iterations on updateViewModel because the wrong variable is being used to check against ignored properties. #199

Open
gracezlive opened this issue Oct 22, 2014 · 0 comments · May be fixed by #201

Comments

@gracezlive
Copy link

In a data model that contains many nested collections, it's essential to avoid unnecessary recursions. We have been using "ignore" to prune any deep branches in our data model that could cause stack overflow during mapping. However the method visitPropertiesOrArrayEntries is incorrectly checking a property name against the ignore option, at a sub-collection level, so all our ignored properties are being visited by updateViewModel anyway.

Current line 443: if (ko.utils.arrayIndexOf(options.ignore, fullPropertyName) != -1) {

It should be: if (ko.utils.arrayIndexOf(options.ignore, indexer) != -1) {

And the same issue is with copy and observe.

gracezlive pushed a commit to gracezlive/knockout.mapping that referenced this issue Oct 22, 2014
Changed method visitPropertiesOrArrayEntries to use "indexer" to compare to options.ignore, copy, and observe.
@ghost ghost linked a pull request Nov 11, 2014 that will close this issue
dregre pushed a commit to dregre/knockout.mapping that referenced this issue Feb 17, 2016
dregre pushed a commit to dregre/knockout.mapping that referenced this issue Feb 17, 2016
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 a pull request may close this issue.

1 participant