Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

fix($parse): reduce false-positives in isElement tests #5675

Closed
wants to merge 2 commits into from

Conversation

caitp
Copy link
Contributor

@caitp caitp commented Jan 7, 2014

There are always going to be false positives here, unfortunately. But testing
different properties will hopefully reduce the number of false positives in a
meaningful way, without harming performance too much.

Closes #4805

There are always going to be false positives here, unfortunately. But
testing different properties will hopefully reduce the number of false
positives in a meaningful way, without harming performance too much.

Closes angular#4805
@gsklee
Copy link
Contributor

gsklee commented Jan 7, 2014

@caitp
Copy link
Contributor Author

caitp commented Jan 7, 2014

Those aren't really related to this issue, I think they can be fixed seperately, unless it's super important to people to keep those in sync

@gsklee
Copy link
Contributor

gsklee commented Jan 7, 2014

@caitp I think it should be in sync; the one you fixed is actually an isElement(obj) (as suggested by the comment) but written out explicitly to avoid a function call for performance.

@caitp
Copy link
Contributor Author

caitp commented Jan 7, 2014

yes, I'm aware --- I'm not opposed to making the change, but it's not really atomic to this particular bug, and it's usually nice to have good atomicity in changesets so that it's very clear what is changed and why.

I can open another PR with those, or add another commit to this one, depending on what people think is the better approach. @IgorMinar sorry to ping you, do you have a preference for this?

@gsklee
Copy link
Contributor

gsklee commented Jan 7, 2014

That makes a point; perhaps just add another commit?

@ghost ghost assigned tbosch Jan 8, 2014
@caitp
Copy link
Contributor Author

caitp commented Jan 8, 2014

I'll squash or remove the commit if it's asked for

Complimentary change to match changed $parse behaviour.
@@ -569,7 +569,7 @@ var trim = (function() {
function isElement(node) {
return !!(node &&
(node.nodeName // we are a direct element
|| (node.on && node.find))); // we have an on and find method part of jQuery API
|| (node.prop && node.attr && node.find))); // we have an on and find method part of jQuery API
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this isn't really in sync with the stuff in $parse, and wasn't to begin with (not looking at the children property). Adding it actually breaks a lot of tests (on travis, seems to pass everything locally). Hmm.

@IgorMinar
Copy link
Contributor

lgtm

@caitp caitp closed this in 5fe1f39 Feb 21, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ng-repeat throws a 'isecdom' error when iterating over an array with a "on" property
4 participants