-
Notifications
You must be signed in to change notification settings - Fork 27.5k
fix(merge): regExp should not be treated as a objects when merging. #12419
Conversation
|
||
expect(dst.regexp).not.toBe(src.regexp); | ||
expect(isRegExp(dst.regexp)).toBeTruthy(); | ||
expect(dst.regexp.toString() === src.regexp.toString()).toBeTruthy(); |
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 we just want toBeTrue
here. Looks ok to me
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.
Or toBe(otherString)
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.
Thanks @caitp, i had updated with expect(dst.regexp.toString()).toBe(src.regexp.toString());
merge(dst, src); | ||
|
||
expect(dst.regexp).not.toBe(src.regexp); | ||
expect(isRegExp(dst.regexp)).toBeTruthy(); |
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.
expect(isRegExp(dst.regexp)).toBeTrue();
i'll fix it myself, lgtm |
Thanks! |
Thanks @caitp |
angular.merge({ key: /regexp/ }) now works the way you'd expect it to. Horray! Closes angular#12419 Closes angular#12409
angular.merge({ key: /regexp/ }) now works the way you'd expect it to. Horray! Closes angular#12419 Closes angular#12409
While merging two objects RegExp should not be treated same as the object.
Closes : #12409