-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
I've been catching up on some spec reading, and noticed the example in the scopes proposal. The bracketed region is the region where message -> _m
is renamed in the proposal:
var _x = 1;
function _z(_m) [{
let _y = 2;
console.log(_m + _y);
}]
console.log("Hello World2"); // <- Inlined
Instead, it should be
var _x = 1;
function _z([_m) {
let _y = 2;
console.log(_m + _y);
}]
console.log("Hello World2"); // <- Inlined
since _m
can be used in parameter initializers of later arguments, for example function _z(_m, _k = _m) {
. Similarly in loop statements one can do stuff like for (const { a, b = a } of arr)
.
I suspect this may be a common problem for generators since it's not really a 'scope range' as a programmer may normally think of it, so it may be worth calling out or at least updating the example.
Metadata
Metadata
Assignees
Labels
No labels