🎄
ENCA 15日目: typeof の implementation-defined を削除
typeof の implementation-defined を削除
歴史的経緯から typeof の結果に implementation-defined が含まれていました。
| Type of val | Result |
|---|---|
| Undefined | "undefined" |
| Null | "object" |
| Boolean | "boolean" |
| Number | "number" |
| String | "string" |
| Symbol | "symbol" |
Object (ordinary and does not implement [[Call]]) |
"object" |
Object (standard exotic and does not implement [[Call]]) |
"object" |
Object (implements [[Call]]) |
"function" |
Object (non-standard exotic and does not implement [[Call]]) |
Implementation-defined. Must not be "undefined", "boolean", "function", "number", "symbol", or "string". |
そして実際に Internet Explorer 10 で "unknown" を返すオブジェクトが存在しました。
今となってはこの仕様は不要であるということで、2019年3月にこの implementation-defined を取り除く変更が承認されました。
Discussion