Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Path to Stage 4! #21

Closed
24 of 28 tasks
ljharb opened this issue Sep 28, 2017 · 10 comments
Closed
24 of 28 tasks

Path to Stage 4! #21

ljharb opened this issue Sep 28, 2017 · 10 comments

Comments

@ljharb
Copy link
Member

ljharb commented Sep 28, 2017

Stage 4

  • committee approval
  • implement in two stable browsers/engines
  • significant in-the-field experience
  • ecma262 PR approved
  • prepare ecma262 (PR)
  • merge test262 tests
  • write test262 tests (PR)
  • resolve final IsRegExp question issue

Stage 3

Stage 2

  • receive developer feedback
  • committee approval
  • spec text written
  • spec reviewers selected
@peterwmwong
Copy link

@ljharb FYI - an initial V8 implementation has landed (behind a flag) https://chromium-review.googlesource.com/c/v8/v8/+/981893

@mathiasbynens

This comment has been minimized.

@chicoxyzzy
Copy link
Member

chicoxyzzy commented Aug 8, 2018

It's implemented in core-js now

@ljharb

This comment has been minimized.

@littledan

This comment has been minimized.

@ljharb

This comment has been minimized.

mathiasbynens added a commit to mathiasbynens/proposal-string-matchall that referenced this issue Aug 8, 2018
@anba outlined two separate concerns about the remaining `IsRegExp` call in `MatchAllIterator`. Quoting from tc39#34 (comment):

1. When `MatchAllIterator` is called from `RegExp.prototype [ @@matchall ]`, we should/have to assume the user explicitly decided to treat `R` as a RegExp object, so having an additional `IsRegExp` call to change this decision seems questionable. It’s also not consistent with how the other `RegExp.prototype` methods work.

2. When `MatchAllIterator` is called from `String.prototype.matchAll`, I’d prefer to handle it more like the other `String.prototype` methods which create RegExp objects (that means `String.prototype.match` and `String.prototype.search`), because I want to avoid adding yet another way to handle RegExp sub-classes. There are already two different RegExp sub-classing/extension interfaces: the `RegExp.prototype` methods all call `RegExpExec`, which means sub-classes, or any other classes, only need to provide their own `exec` methods when they want to reuse the other `RegExp.prototype` methods. And in addition to that, the `@@match/replace/search/split` interfaces allow sub-classes to provide their own implementations for just these methods. The `matchAll` proposal in its current form adds another dimension to this by providing different code paths depending on whether or not an object is RegExp-like (as per the `IsRegExp` abstract operation). In my opinion we should only support RegExp sub-classing in two ways: 1) Either the RegExp sub-class has `%RegExpPrototype%` on its prototype chain, or 2) the RegExp sub-class copies the relevant methods from `%RegExpPrototype%` into its prototype object.

Ref. tc39#21, tc39#34.
@mathiasbynens

This comment has been minimized.

ljharb added a commit that referenced this issue Aug 8, 2018
 - `String.prototype.matchAll`:
   - use `RegExpCreate` when `Symbol.prototype.matchAll` is not found
   - fall back to regex coercion otherwise
 - `RegExp.prototype[Symbol.matchAll]`:
   - receiver is assumed to be a regex implicitly
 - remove `MatchAllIterator` abstract operation

Thus, `IsRegExp` call no longer exists.

Addresses #21. Addresses #34. Closes #37.
ljharb added a commit that referenced this issue Aug 9, 2018
 - `String.prototype.matchAll`:
   - use `RegExpCreate` when `Symbol.prototype.matchAll` is not found
   - fall back to regex coercion otherwise
 - `RegExp.prototype[Symbol.matchAll]`:
   - receiver is assumed to be a regex implicitly
 - remove `MatchAllIterator` abstract operation

Thus, `IsRegExp` call no longer exists.

Addresses #21. Addresses #34. Closes #37.
@mathiasbynens

This comment has been minimized.

@chicoxyzzy
Copy link
Member

It's unflagged in Firefox 67 now

@ljharb
Copy link
Member Author

ljharb commented Mar 26, 2019

This proposal reached stage 4 at today's TC39, yay!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants