Bug 155332 - [ES6] RegExp sticky flag should be ignored in String.match when global flag is given
Summary: [ES6] RegExp sticky flag should be ignored in String.match when global flag i...
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Michael Saboff
Depends on:
Reported: 2016-03-10 15:29 PST by Michael Saboff
Modified: 2016-03-10 15:48 PST (History)
4 users (show)

See Also:

Patch (2.81 KB, patch)
2016-03-10 15:33 PST, Michael Saboff
sbarati: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Saboff 2016-03-10 15:29:03 PST
In change set r197869, logic was added to handle String.match(re) when the RegExp has both the global and sticky flags set.  In the ES6 spec, section step 6 that describes operation when the global flag is set doesn't reference the sticky flag or any operational changes due to the sticky flag.  When the global flag is not set, step 5 of the same section says that the operation is the same s RegExpExec, which does have sticky dependent behavior.  Therefore, the logic that handles when both the sticky and global flags are set should be removed.
Comment 1 Michael Saboff 2016-03-10 15:33:22 PST
Created attachment 273637 [details]
Comment 2 Saam Barati 2016-03-10 15:37:19 PST
Comment on attachment 273637 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=273637&action=review

> Source/JavaScriptCore/runtime/StringPrototype.cpp:1057
> +        if (!global && (sticky = regExp->sticky())) {

I think this is easier to read if the sticky isn't assigned in the "if"
Comment 3 Michael Saboff 2016-03-10 15:48:46 PST
Committed r197963: <http://trac.webkit.org/changeset/197963>