Internet Explorer <= 10 has no support for __proto__. This conditional polyfill works around that, so that static methods like reopen may be used. There are some caveats though.

For more information, please see: Issue #436 (comment)

Show:

Methods

Properties

defaults
(
  • obj
  • defaults
)
Object

Assigns all properties of defaults to obj, if they are not already defined on obj. This means that obj is mutated in place.

Taken from:

https://github.com/babel/babel/blob/64eafad472ebac6333671fff65a9669739e6cd88/packages/babel-helpers/src/helpers.js#L287-L299

Parameters:

  • obj Object

    The object to assign the default properties to

  • defaults Object

    The object that provides all default properties to be assigned

Returns:

Object:

The obj that was passed in

fixProto
(
  • Class
)
Function

Conditionally attempt to polyfill support for __proto__ in environments that do not support it.

If __proto__ is not supported, this function assigns all properties and methods pf Class.__proto__ to Class itself.

Parameters:

Returns:

Function:

The Class that was passed in

isProtoSupported

Boolean const

Whether or not this environment supports __proto__. IE <= 10 is known to not support it-

More information on __proto__:

https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/proto