Why isn't Map subclassable in chrome/node?

前端 未结 4 613
无人共我
无人共我 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 06:59

    For anyone running into this in 2018:

    import ES6Map from 'es6-map/polyfill'
    
    class MyMap extends ES6Map {
      constructor () {
        super()
      }
    }
    

提交回复
热议问题