Ticket #56 (closed feature: fixed)

Opened 2 years ago

Last modified 1 year ago

RegExp: Exposing properties "match" and "nCapturingParens"

Reported by: lth Assigned to: anonymous
Type: feature Priority: minor
Milestone: M2 Component: Proposals
Version: 4 Keywords:
Cc:

Description

The RI currently exposes the following two properties on RegExp? objects:

  • match, a method to match the regex in a string at one location
  • nCapturingParens, a read-only property

These are used by methods in the string class, which is why they are exposed.

In E262-3 they were hidden.

IMO it is "nice" for them to be exposed since we model the language in the language, but I can if necessary hide them using some "implementation-private" name space to signal that they can't be there.

Should these properties be exposed?

Attachments

Change History

Changed 2 years ago by lth

Note, these are both currently in the "intrinsic" namespace.

Changed 2 years ago by lth

Other relevant information: the RegExp? engine also needs to export the type "MatchResult?", the type "CapArray?" (used by MatchResult?), and the constant value "failure" (of type MatchResult?) from the RegExpInternals? package. MatchResult? is sort-of-opaque at present, because the typedef "MatchResult?" is exported but not the types it expands to. Yet client code can and does look into that type...

Messy...

Changed 1 year ago by lth

  • status changed from new to closed
  • resolution set to fixed

The helper namespace is used for these as appropriate.

Note: See TracTickets for help on using tickets.