02:57
<Jack Works>
{ length: 0 } needs to match an empty string, for example
We don't do type coerce, but do we need to do primitive boxing?
02:57
<ljharb>
i mean, we could decide not to. but that would be a radical departure from the rest of the language.
02:57
<ljharb>
if you can do x.length on it, and you can do const { length } = x on it, you should be able to { length } pattern match on it
02:58
<ljharb>
so i think "consistency with destructuring" forces us to do boxing, full stop
03:00
<Jack Works>
let's decide it next group meeting
03:00
<ljharb>
sure, that's fine, but i'm not clear on what possible argument could justify "different from destructuring"
03:01
<Jack Works>
Probably still a little too early for a thorough review of the spec, but I noticed that https://tc39.es/proposal-pattern-matching/#sec-match-expression-clauses-runtime-semantics-evaluation only cares about ECMAScript language values rather than completion values, which doesn't work as it prevents ThrowCompletion from bubbling out of match (or return/break/continue in the event do expressions are supported).
returns either a normal completion containing either an ECMAScript language value or not-matched, or an abrupt completion
03:01
<ljharb>
also MM just posted an issue moments ago, and i'm not sure i understand it, but it seems like it's in direct conflict with the "bindings by default" change we made in response to yulia's feedback
03:01
<Jack Works>
Why do you say so? It contains Abrupt Completion
03:54
<rbuckton>
returns either a normal completion containing either an ECMAScript language value or not-matched, or an abrupt completion

Not the return. Step 2 of the 2nd and 3rd productions:

  1. Let result be ? MatchExpressionClausesEvaluation of MatchExpressionClauses with arguments subject and cacheGroup.
  2. If result is an ECMAScript language value, return result.
  3. Return ? MatchExpressionClauseEvaluation of MatchExpressionClause with arguments subject and cacheGroup.

result will never be an ECMAScript language value. We need to check for a normal completion whose value is not-matched.

03:55
<rbuckton>
Wait, I'm an idiot. That's handled by 1.
03:55
<rbuckton>
That's what I get for reading spec text on a 5hr car trip.
03:57
<rbuckton>
The use of ReturnIfAbrupt (?) sort of obfuscates the intention, IMO. It was easy to overlook the fact that what we care about is not-matched.
03:58
<rbuckton>
Either by explicitly looking for not-matched, or by adding an "Assert: result is not-matched"
04:08
<Jack Works>
I'll do that next time