-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Conversation
zloirock#492 Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Since it works only for the global version, need to add empty files with similar names to |
RegExpWrapper | ||
); | ||
|
||
if (UNSUPPORTED_Y) setInternalState(result, { sticky: sticky }); |
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.
Maybe it would be better to set it only when sticky
is true
?
|
||
module.exports = function (it) { | ||
return it.sticky; | ||
}; |
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.
Also required stable/regexp/sticky
, features/regexp/sticky
, the same for RegExp#test
and adding them to tests/commonjs
.
I think I'll fix it by myself. Thanks! |
This PR implements the sticky flag for Regular Expressions and
RegExp#test
delegation toRegExp#exec
. It is based on the stale PR from @nicolo-ribaudo (many thanks!!) #492.Changes include:
Co-authored-by
info in commit)es.string.split
RegExp#test
delegation toRegExp#exec
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).