Re: [whatwg/streams] Reference impl: Use arrow functions for `size` functions (#1142)

I do find this to very odd and unexpected behavior, but it is required by ecmascript.

Relevant part of the spec, from [14.3.1.2 Runtime Semantics: Evaluation](https://tc39.es/ecma262/#sec-let-and-const-declarations-runtime-semantics-evaluation) of `let` or `const` bindings:

    3. If IsAnonymousFunctionDefinition(Initializer) is true, then
        a. Let value be NamedEvaluation of Initializer with argument bindingId.

capturing `bindingId` and passing it into the evaluation of the anonymous function expression, where it's eventually passed through to [15.3.4 Runtime Semantics: InstantiateArrowFunctionExpression](https://tc39.es/ecma262/#sec-runtime-semantics-instantiatearrowfunctionexpression), and then to [SetFunctionName](https://tc39.es/ecma262/#sec-setfunctionname).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/1142#issuecomment-871973575

Received on Thursday, 1 July 2021 06:49:58 UTC