ECMAScript仕様輪読会 #85
前回: ECMAScript仕様輪読会 #84
Cosenseの招待リンク: https://scrapbox.io/projects/esspec/invitations/85b96c9fa718ce5185e307196ed8fb53
connpass: https://esspec.connpass.com/
Discord: https://discord.gg/59S3y6weQj
ES Spec Draft: https://tc39.es/ecma262/
multipage: https://tc39.es/ecma262/multipage/
資料: https://speakerdeck.com/syumai/ecmascriptshi-yang-wodu-munonibi-yao-nazhi-shi-daiziesutoban
読み物リスト
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
esmeta playground: https://es-meta.github.io/playground/
時事ネタ
JSConf
8/31まで
https://docs.google.com/forms/d/e/1FAIpQLSf0QHajs3kQyax0zDX3W6KTFom7LqSqrIEmCp91tV_ccA9QWA/viewform
TSKaigi Hokuriku
9/15まで
https://tskaigi.hatenablog.com/entry/2025/08/05/112439
自己紹介 (近況報告)
syumai syumai.icon
Twitter: https://twitter.com/__syumai GitHub: https://github.com/syumai
Go / TSを書いて暮らしてます
iwatsurut
とくに、イベントもなく過ごしています。
igrep(山本悠滋)
https://github.com/igrep/
ECMA-262に貢献できた https://github.com/tc39/ecma262/pull/3671
今更ながらTailscaleを初めて使った。便利
前回のあらすじ
今回のメモ
code:js
const sym = Symbol("a");
undefined
Object(sym);
Symbol: Symbol(a)
typeof Object(sym);
'object'
const symObj = Object(sym);
undefined
symObj.valueOf()
Symbol(a)
symObj.double = function() { return this.toString() + this.toString() }
Function (anonymous)
symObj.double()
'Symbol(a)Symbol(a)'
code:js
const subErr = new Error("sub error");
const err = new Error("main error", {
cause: subErr,
});
console.log(err.toString()); // Error: main error
code:js
function childFunc() {
throw Error("child error!");
}
function parentFunc() {
try {
childFunc()
} catch(err) {
throw Error("parent error!", err);
}
}
parentFunc();
/*
/Users/syumai/go/src/github.com/syumai/til/js/esspec85/c.js:9
throw Error("parent error!", err);
^
Error: parent error!
at parentFunc (/Users/syumai/go/src/github.com/syumai/til/js/esspec85/c.js:9:11)
at Object.<anonymous> (/Users/syumai/go/src/github.com/syumai/til/js/esspec85/c.js:13:1)
*/
code:js
const notErr = { message: "not error" };
const isErr = Error("error");
console.log(
Error.isError(notErr),
Error.isError(isErr),
);
code:js
Error.prototype.message = "hoge fuga";
console.log(Error.prototype.message); // hoge fuga
code:js
Error.prototype.name = "Broken Error";
class MyError1 extends Error {}
class MyError2 extends Error {}
const err1 = new MyError1();
const err2 = new MyError2();
console.log(err1.name); // Broken Error
console.log(err2.name); // Broken Error
code:js
const obj = {
message: "msg",
};
console.log(Error.prototype.toString.bind(obj)()); // Error: msg