Implement RegExp s (dotAll) flag
Categories
(Core :: JavaScript Engine, enhancement, P3)
Tracking
()
People
(Reporter: leonardo.balter, Assigned: iain)
References
()
Details
(4 keywords)
Attachments
(2 files)
Reporter | ||
Comment 1•8 years ago
|
||
Updated•8 years ago
|
Reporter | ||
Comment 2•8 years ago
|
||
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Comment 3•7 years ago
|
||
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Comment 4•7 years ago
|
||
Updated•6 years ago
|
Updated•5 years ago
|
Comment 6•5 years ago
|
||
(In reply to David Spector from comment #7)
but I see no reason to delay further, as the documentation (see citation in my bug report) already states that the s flag exists. It can't be very difficult to implement, in my opinion, from a technical point of view.
I believe that Firefox documentation and software should be kept in synchronization somehow. Perhaps you don't store the documentation in the same git as the software? You might consider coordinating them better, as I've seen other examples of inconsistency.
Please note that MDN web docs is a browser comprehensive wiki documenting the web standards, it's not (just) a "Firefox documentation". And the browser compatibility section of the page you referenced in bug 1579867 clearly states that the "dotAll" feature covered here is not supported by Firefox yet.
As far as I can tell, the relevant code for this touches the files at https://searchfox.org/mozilla-central/search?q=&case=false®exp=false&path=js%2F**%2FRegExp*, presumably mainly https://searchfox.org/mozilla-central/source/js/src/builtin/RegExp.cpp.
Having said that, I am far from being able to implement this myself.
Sebastian
Comment 7•5 years ago
|
||
(In reply to github from comment #10)
In 2018, the dotall flag was added to the specification. Here we are approaching 2020 and Firefox still hasn't implemented it. In what year will Mozilla implement the 2018 specification?
Please stop asking this question in every single regular expression related bug, you already got an answer in bug 1362154.
Comment 8•5 years ago
|
||
(In reply to David Spector from comment #13)
(In reply to Tom Schuster [:evilpie] from comment #11)
Please stop asking this question in every single regular expression related bug, you already got an answer in bug 1362154.
- To whom are you directing this statement? To me? Someone else?
- What answer are you referring to in #1362154? It is not obvious.
Sending brief, ambiguous, and nasty comments is not helpful to fixing old bugs.
Sorry, this is an answer to another comment that is now hidden. Ian is actively working on updating our copy of the v8 regular expression code that should enable us to run all new regular expression features from ES2018 (bug 1362154 comment 22). You can follow this work in the meta bug 1367105.
Assignee | ||
Comment 9•5 years ago
|
||
This patch adds the boilerplate necessary to support a new regexp flag. Externally visible changes (parsing the flag, the dotAll property on the prototype) are guarded behind ENABLE_NEW_REGEXP.
The actual implementation of dotAll comes for free with the fresh import of irregexp (bug 1367105).
There is one test (tests/non262/RegExp/prototype.js) that needs to be updated when this is turned on to add "dotAll" to the list of expected properties on the RegExp prototype. I will attach that change to my patch that flips ENABLE_NEW_REGEXP to be on by default.
Updated•5 years ago
|
Assignee | ||
Comment 10•5 years ago
|
||
Depends on D66844
Comment 11•5 years ago
|
||
Comment 12•5 years ago
|
||
Backed out 2 changesets for causing sm failures in RegExp/flags.js
Backout link: https://hg.mozilla.org/integration/autoland/rev/18dd38f7319c182e9467df8f127552187c123670
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=294111415&repo=autoland&lineNumber=90362
Comment 13•5 years ago
|
||
Assignee | ||
Comment 14•5 years ago
|
||
I missed one externally visible change: RegExp.prototype.flags can be called on non-regexp objects, which can have dotAll properties defined. I could have sworn that this code had been through several try builds, but I guess I must have changed RegExpFlagsGetter afterwards. I've uploaded a fix and kicked off a precautionary try build. I will reland once the try build completes.
The jsreftest failures are the same testcase.
Comment 15•5 years ago
|
||
Comment 16•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7f288e81410d
https://hg.mozilla.org/mozilla-central/rev/736f7749e6a7
Comment 17•5 years ago
|
||
Since this is now closed, shouldn't today's nightly (mar/25/2020) be passing the test at http://kangax.github.io/compat-table/es2016plus/ then?
Assignee | ||
Comment 18•5 years ago
|
||
No, this depends on bug 1367105. There's no more dotAll-specific work to be done, but we won't have dotAll support until that lands.
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 19•5 years ago
|
||
Fixed by the landing of bug 1634135.
Updated•4 years ago
|
Comment 20•4 years ago
|
||
Developer docs:
https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/78#JavaScript
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/dotAll
Description
•