Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In Safari, there are some non DOM nodes in the elements array. That's why there is an issue. Now we check whether we've parantNode before invoking it
- Loading branch information
c0ce85d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arunoda Since we are using ecmascript package, I think we can use for-of as it uses babel and we support for-of functionality.
So, it will be
c0ce85d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. I am good with it. Send me a PR. And keep the if block.
c0ce85d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arunoda I've checked the example in the docs, it says, we can use for-of to iterate the NodeList normally. The babel helps us with ie9+. I checked in browsers too.
So, we don't need this parentNode check. Are you okay with that? I'll send a PR.
c0ce85d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you missed the point. We need that if check. In safari, there are some nodes in the
elements
which are not DOM nodes. That's what the problem.Before you send the PR, try whether it's working on safari. Don't just run tests. Try using a real app.
c0ce85d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arunoda I understand. There is also length and NodeList prototype. Since they are not iterable objects, they won't be processed with for-of.
I just checked in the real app with blaze and FR. Everything works as expected.
c0ce85d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.