Implement RegExp.prototype.flags

RESOLVED FIXED in mozilla37

Status

()

defect
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: 446240525, Assigned: 446240525)

Tracking

(Blocks 1 bug, {dev-doc-complete})

Trunk
mozilla37
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [DocArea=JS])

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

4 years ago
js> /foo/yg.flags
"gy"
js> Object.getOwnPropertyDescriptor(RegExp.prototype,"flags").get.call({sticky:1,unicode:1})
"yu"
(Assignee)

Comment 2

4 years ago
Posted patch bug-1108467-v1.patch (obsolete) — Splinter Review
Assignee: nobody → 446240525
Attachment #8533163 - Flags: review?(till)
Comment on attachment 8533163 [details] [diff] [review]
bug-1108467-v1.patch

Review of attachment 8533163 [details] [diff] [review]:
-----------------------------------------------------------------

This looks excellent, thanks!

r=me with feedback addressed.

::: js/src/tests/ecma_6/RegExp/flags.js
@@ +1,3 @@
> +/*
> + * Any copyright is dedicated to the Public Domain.
> + * http://creativecommons.org/licenses/publicdomain/

You can just leave out the license header: all test files default to CC0. If you keep it, please change the URL to https://creativecommons.org/publicdomain/zero/1.0/.

@@ +10,5 @@
> +
> +assertEq(RegExp.prototype.flags, "");
> +assertEq(/foo/iymg.flags, "gimy");
> +assertEq(RegExp("").flags, "");
> +assertEq(RegExp("", "mygi").flags, "gimy");

Please add a test that includes "u" when creating a regexp but doesn't reflect it in the `flags` getter. That way, we should get a heads-up once we add support for unicode regexps.
Attachment #8533163 - Flags: review?(till) → review+
(Assignee)

Comment 4

4 years ago
Posted patch feedback addressed (obsolete) — Splinter Review
Attachment #8533163 - Attachment is obsolete: true
Attachment #8533470 - Flags: review?(till)
(Assignee)

Comment 5

4 years ago
Comment on attachment 8533470 [details] [diff] [review]
feedback addressed

Review of attachment 8533470 [details] [diff] [review]:
-----------------------------------------------------------------

https://bugs.ecmascript.org/show_bug.cgi?id=3423
Attachment #8533470 - Flags: review?(till)
(Assignee)

Comment 6

4 years ago
Attachment #8533470 - Attachment is obsolete: true
Attachment #8533506 - Flags: review?(till)
Comment on attachment 8533506 [details] [diff] [review]
s/gimyu/gimuy/

Review of attachment 8533506 [details] [diff] [review]:
-----------------------------------------------------------------

Wonderful.

It occurs to me just now that we might as well have self-hosted this. Too late now, though, so let's just land it.
Attachment #8533506 - Flags: review?(till) → review+
https://hg.mozilla.org/mozilla-central/rev/bc5ad20e8f27
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37

Updated

4 years ago
See Also: → 1109577

Updated

4 years ago
Depends on: 1120151
You need to log in before you can comment on or make changes to this bug.