Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sticky RegExp 'y' and RegExp#test delegation #732

Merged
merged 5 commits into from
Dec 17, 2019

Conversation

cvle
Copy link
Contributor

@cvle cvle commented Dec 17, 2019

This PR implements the sticky flag for Regular Expressions and RegExp#test delegation to RegExp#exec. It is based on the stale PR from @nicolo-ribaudo (many thanks!!) #492.

Changes include:

Tested in a multitude of browser versions using BrowserStack starting from the minimum supported versions of core-js.

My goal was to make https://github.com/projectfluent/fluent.js work in IE11, which I've successfully verified! (also don't forget to use a different markup parser for those trying the same: https://gist.github.com/cvle/67b69517b7d3e83f5de9ccace270415c).

@zloirock
Copy link
Owner

Since it works only for the global version, need to add empty files with similar names to packages/core-js-pure/overwrite.

RegExpWrapper
);

if (UNSUPPORTED_Y) setInternalState(result, { sticky: sticky });
Copy link
Owner

@zloirock zloirock Dec 17, 2019

Choose a reason for hiding this comment

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

Maybe it would be better to set it only when sticky is true?


module.exports = function (it) {
return it.sticky;
};
Copy link
Owner

@zloirock zloirock Dec 17, 2019

Choose a reason for hiding this comment

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

Also required stable/regexp/sticky, features/regexp/sticky, the same for RegExp#test and adding them to tests/commonjs.

@zloirock
Copy link
Owner

I think I'll fix it by myself. Thanks!

@zloirock zloirock merged commit 80d7bfe into zloirock:master Dec 17, 2019
zloirock added a commit that referenced this pull request Dec 17, 2019
@nicolo-ribaudo
Copy link
Contributor

Thanks @cvle for working on my PR, and @zloirock for the quick fixes!

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

Successfully merging this pull request may close these issues.

3 participants