Skip to content

fixed #522; broken check in theme processing #530

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

Merged
merged 2 commits into from
Jun 21, 2016

Conversation

BrianAdams
Copy link
Contributor

This appeared to be a simple missing object qualifier for the short circuit logic. Added it in.

@jdorn
Copy link
Owner

jdorn commented Nov 19, 2015

matchKey is defined at the top of that file. Did the current code cause an error for you?

@BrianAdams
Copy link
Contributor Author

Yes. If the element (in my case a document fragment) is being evaluated as does not have a matchkey function defined, the code crashes with element.matchkey being undefined. To your point the matchkey variable that was originally being checked for existence is defined above which is why I am assuming it was guard code that was guarding the wrong thing. Matckey vs element.matchkey.

@aneesv
Copy link

aneesv commented Jan 17, 2016

👍

@jdorn
Copy link
Owner

jdorn commented Feb 11, 2016

I still don't quite get what the original error was. Do you have an example schema/code that replicates it?

In your code, elem.matchKey will always be undefined and that if block will never be reached. If you change it to elem[matchKey] instead, it should behave as expected.

@BrianAdams
Copy link
Contributor Author

Thanks for the catch. The problem is that the code crashes if it processes an element that does not have the function specified in matchkey. In this case, a "document fragment' element is getting iterated over, and is does not have a matching function nor a ParentNode.

@piascikj
Copy link

👍

@jdorn jdorn merged commit 24ac70c into jdorn:master Jun 21, 2016
jdorn added a commit that referenced this pull request Jun 21, 2016
Merge remote-tracking branch 'origin/pr/530'
@piascikj
Copy link

Woot!

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.

4 participants