Skip to content

Instantly share code, notes, and snippets.

@Raynos
Created January 23, 2012 19:48
Show Gist options
  • Save Raynos/1665192 to your computer and use it in GitHub Desktop.
Save Raynos/1665192 to your computer and use it in GitHub Desktop.
Shim status of ES6

ES6 what can be shimmed and what not.

Currently only lists things that can be shimmed or are experimentally implemented

Note that for any kind of decent ES6 support we need an ES6 transpiler. A few projects are attempting this Reference SO question

Firefox

  • WeakMaps, Maps and Sets
  • Old proxies (not direct proxies)
  • let, const

Chrome (requires harmony flags on)

  • let, const
  • WeakMaps, Maps and Sets
  • old proxies.

Shimmables of ES6

The following are currently shimmed. Note a lot of these are not natively implemented anywhere yet.

String extras

By ES6-shim

  • String.prototype.repeat
  • String.prototype.startsWith
  • String.prototype.endsWith
  • String.prototype.contains

Array extras

By ES6-shim]1

  • Array.from
  • Array.of

Number extras

By ES6-shim

  • Number.isFinite
  • Number.isNaN
  • Number.toInteger
  • Number.isInteger

Object extras

By ES6-shim

  • Object.getOwnPropertyDescriptors
  • Object.getPropertyDescriptor
  • Object.getPropertyNames
  • Object.is
  • Object.isnt

Math extras

By ES6-shim

  • Math.sign

By fdlibm

  • Math.log10
  • Math.log1p
  • Math.expm1
  • Math.cosh
  • Math.sinh
  • Math.tanh
  • Math.acosh
  • Math.asinh
  • Math.atanh
  • Math.hypot
  • Math.trunc
  • Math.sign

By rwldrn

  • Math.cbrt

Maps, Sets and WeakMaps

ES6-shim covers Map and Set. WeakMap shim. ES6 collections also has alternative shims with special note on Andrea's WeakMap implementation choice.

Unshimmable subset of ES6

These cannot be shimmed currently.

Any new syntax

Can not be shimmed. This includes

  • let
  • const
  • typeof null === "null"

Proxies

I've not seen any implementation. It's nearly impossible to emulate without severe restrictions. Note it's possible to emulate the newer specification of proxies from the older specification (firefox/chrome have the older implementation lying around)

Modules

module syntax cannot be shimmed. Depending on what the programmatic module API is like it may be possible to shim but it's not finalized.

@arthurvr
Copy link

Hi there! The name of the String.prototype.contains method must be changed ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment