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

fix(angular.copy): clone regexp flags correctly #8337

Closed
wants to merge 1 commit into from
Closed

fix(angular.copy): clone regexp flags correctly #8337

wants to merge 1 commit into from

Conversation

shahata
Copy link
Contributor

@shahata shahata commented Jul 25, 2014

Closes #5781

@mary-poppins
Copy link

Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.

  • Uses the issue template (#8337)

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

@shahata shahata added cla: yes and removed cla: no labels Jul 25, 2014
@@ -775,7 +775,8 @@ function copy(source, destination, stackSource, stackDest) {
} else if (isDate(source)) {
destination = new Date(source.getTime());
} else if (isRegExp(source)) {
destination = new RegExp(source.source);
destination = new RegExp(source.source, source.toString().match(/[^\/]*$/)[0]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that is very neat. You're the first person I've seen do it that way.
Normally people just go through each of the flags in turn.

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.

angular.copy doesn't preserve RegExp options
3 participants