tc39 / proposal-pattern-matching

Pattern matching syntax for ECMAScript
https://tc39.es/proposal-pattern-matching/
MIT License
5.46k stars 89 forks source link

[spec] add builtin matchers with proper semantics and location #263

Closed ljharb closed 2 years ago

ljharb commented 2 years ago

Followup to #262.

I will file issues for the open questions contained herein:

  1. Error subclasses: how are they checked?
  2. Promise: should we accept thenables? Current semantics are "IsPromise", ie, internal slot.
  3. other constructors, in the last clause section marked "TODO"

There's spec TODOs for me for:

  1. the RegExp.prototype builtin matcher
  2. builtin matchers for relevant boxed primitives (that have the same semantics primitives will be hardcoded to have)
  3. the [[TypedArrayName]] comparison needs tightening up

I'm going to merge this ASAP; we can iterate later.