Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

Make non-global RegExps global so they can "replace all" occurrences #20

Closed
wants to merge 1 commit into from

Conversation

mathiasbynens
Copy link
Member

This is one of the potential solutions to #16.

@mathiasbynens mathiasbynens mentioned this pull request Jul 18, 2019
7 tasks
Copy link
Contributor

@ExE-Boss ExE-Boss left a comment

Choose a reason for hiding this comment

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

I am in favour of this.

@mathiasbynens
Copy link
Member Author

Alternative approach: #24

<emu-alg>
1. Let _rx_ be the *this* value.
1. If Type(_rx_) is not Object, throw a *TypeError* exception.
1. Let _flags_ be ? ToString(? Get(_rx_, `"flags"`)).
Copy link
Member

Choose a reason for hiding this comment

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

if flags is undefined, this should be the empty string, not the string undefined, to match the RegExp constructor.

@mathiasbynens
Copy link
Member Author

We're going with #24 instead.

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.

None yet

3 participants