tc39 / proposal-pattern-matching

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

Rest spec work #260

Closed Jack-Works closed 2 years ago

Jack-Works commented 2 years ago
ljharb commented 2 years ago

I would expect every builtin constructor to have a matcher that checks for the presence of the internal slot its instances are expected to have.

Jack-Works commented 2 years ago

I would expect every builtin constructor to have a matcher that checks for the presence of the internal slot its instances are expected to have.

For example, does TypeError has its own internal slot so we can distinguish it from Error?

ljharb commented 2 years ago

Good question, but yes, I would expect it to validate that it's a TypeError and not another kind of error object.

Jack-Works commented 2 years ago

mostly done.