Why isn't Map subclassable in chrome/node?

前端 未结 4 612
无人共我
无人共我 2021-01-21 06:28

So ES 6 is bringing us Maps (and none too soon). Wishing to subclass Map for my own nefarious purposes, I tried the following (abbreviated for clarity):

function         


        
4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-21 07:08

    Actually, it doesn't really 'work' in FF, since FF also allows to create maps simply by calling Map().

    However, according to http://kangax.github.io/compat-table/es6/ we do not have compatibility for subclassing in modern browser (fascinating enough, IE has some support here).

    tl;dr V8/SpiderMonkey are not fully ES6 compatible yet.

提交回复
热议问题