Closed
Bug 1130798
Opened 10 years ago
Closed 10 years ago
new RegExp().source should return "(?:)"
Categories
(Core :: JavaScript: Standard Library, defect)
Core
JavaScript: Standard Library
Tracking
()
RESOLVED
FIXED
mozilla38
People
(Reporter: arai, Assigned: arai)
Details
(Keywords: dev-doc-complete, site-compat, Whiteboard: [DocArea=JS])
Attachments
(1 file)
7.33 KB,
patch
|
till
:
review+
|
Details | Diff | Splinter Review |
Derived from bug 1120169.
http://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-regexp.prototype.source
> 7. Return EscapeRegExpPattern(src, flags).
http://people.mozilla.org/~jorendorff/es6-draft.html#sec-escaperegexppattern
> If P is the empty String, this specification can be met by letting S be "(?:)".
Currently `source` property returns empty string, and RegExpObject::toString does the replacement.
Assignee | ||
Comment 1•10 years ago
|
||
Green on try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=976d9db08519
Attachment #8560963 -
Flags: review?(till)
Comment 2•10 years ago
|
||
Comment on attachment 8560963 [details] [diff] [review]
Return "(?:)" for source of RegExp with empty pattern.
Review of attachment 8560963 [details] [diff] [review]:
-----------------------------------------------------------------
Nice, thanks.
Attachment #8560963 -
Flags: review?(till) → review+
Comment 3•10 years ago
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]: Potentially backwards-incompatible change
[Suggested wording]: RegExp.prototype.source now returns "(?:)" instead of the empty string for empty regular expressions
[Links (documentation, blog post, etc)]:
[1] https://mail.mozilla.org/pipermail/es-discuss/2012-March/021919.html (Search for RegExp)
[2] https://mail.mozilla.org/pipermail/es-discuss/2012-March/020815.html
Note that this is a potential backwards-compatibility issue as pointed out in [1]. It's been in Safari since 2011 though, so it'll most likely work.
Assignee: nobody → arai_a
Status: NEW → ASSIGNED
relnote-firefox:
--- → ?
relnote-b2g:
--- → ?
Keywords: dev-doc-needed
Updated•10 years ago
|
Keywords: site-compat
Whiteboard: [DocArea=JS]
Assignee | ||
Comment 4•10 years ago
|
||
Comment 5•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox38:
--- → fixed
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Comment 6•10 years ago
|
||
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/source
https://developer.mozilla.org/en-US/Firefox/Releases/38#JavaScript
Keywords: dev-doc-needed → dev-doc-complete
Comment 7•10 years ago
|
||
Added to Aurora/DevEd releasenotes a:
Changed: RegExp.prototype.source now returns "(?:)" instead of the empty string for empty regular expressions
Comment 8•10 years ago
|
||
Added to the compat doc:
https://developer.mozilla.org/en-US/Firefox/Releases/38/Site_Compatibility
You need to log in
before you can comment on or make changes to this bug.
Description
•