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

fix(Angular): properly compare RegExp with other objects for equality #11205

Closed

Conversation

pkozlowski-opensource
Copy link
Member

Fixes #11204

} else if (isRegExp(o1) && isRegExp(o2)) {
return o1.toString() == o2.toString();
} else if (isRegExp(o1)) {
return isRegExp(o2) ? o1.toString() == o2.toString() : false;
} else {
if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) || isArray(o2)) return false;

Choose a reason for hiding this comment

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

Not the same but a similar bug:

angular.equals({}, /lol/);

Copy link
Member Author

Choose a reason for hiding this comment

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

@alexlamsl you are right - going to push an update for those cases as well

@pkozlowski-opensource
Copy link
Member Author

@petebacondarwin / @lgalfaso / @Narretz could one of you guys OK this patch? It is pretty minimal and should be fast to review. Thnx!

@petebacondarwin
Copy link
Contributor

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants