ECMAScript仕様輪読会 #49
前回: ECMAScript仕様輪読会 #48
Scrapboxの招待リンク: https://scrapbox.io/projects/esspec/invitations/85b96c9fa718ce5185e307196ed8fb53
connpass: https://esspec.connpass.com/
Discord: https://discord.gg/59S3y6weQj
ES Spec Draft: https://tc39.es/ecma262/
読み物リスト
Twitter hashtag: #esspec
便利ツール
esspec-memo: https://tars0x9752.github.io/esspec-memo/esspec.html
Scrapbox Codeblock Generator: https://vzvu3k6k.github.io/scrapbox-codeblock/
TC39 Terminology: https://github.com/tc39/how-we-work/blob/main/terminology.md
時事ネタ
自己紹介 (近況報告)
syumai syumai.icon
Twitter: https://twitter.com/__syumai GitHub: https://github.com/syumai
1/25のMeguro.esで話します
https://meguro.es/
Software Design 2月号にCloudflare Workersの連載の3本目載ってます
https://gihyo.jp/magazine/SD/archive/2024/202402
最近は楽器をやっています
tars0x9752 (たーず / naoki aoyama) tars0x9752.icon
我が家に空気清浄機がきた
効いてるのかよくわからない
iwatsurut
とくに、イベントもなく過ごしています。
正月に予習でもしようかと思っていましたが、やっぱりしませんでした。
前回のあらすじ
ASI
MDN にかなり丁寧にまとまっていた: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Lexical_grammar#自動セミコロン挿入
今回の範囲
13 ECMAScript Language: Expressions の 13.1.3 Runtime Semantics: Evaluation
13.1.3 Runtime Semantics: Evaluation
IdentifierのEvaluationなので、結果としてReference Recordを生成する
Reference Record -> 代入などの操作に使われる
https://tc39.es/ecma262/#sec-reference-record-specification-type
13.2 Primary Expression
CoverParenthesizedExpressionAndArrowParameterList
code:js
function f(
...args,
) {
console.log(args);
}
f(1, 2, 3);
/*
/Users/syumai/go/src/github.com/syumai/til/js/esspec49/a.js:2
...args,
^
SyntaxError: Rest parameter must be last formal parameter
NGだが、 ...args のようなパターンでは、パラメータが追加されることがないので困らないはず
*/
code:js
function f(
a,
b,
c,
) {
console.log(a, b, c);
}
f(1, 2, 3);
// これはOK