]>
git.r.bdr.sh - rbdr/dotfiles/blob - atom/packages/vim-mode/node_modules/grim/node_modules/emissary/node_modules/es6-weak-map/node_modules/es5-ext/object/create.js
f813b4661c4498f434925cc883ebaa8af97e3d77
1 // Workaround for http://code.google.com/p/v8/issues/detail?id=2804
5 var create
= Object
.create
, shim
;
7 if (!require('./set-prototype-of/is-implemented')()) {
8 shim
= require('./set-prototype-of/shim');
11 module
.exports
= (function () {
12 var nullObject
, props
, desc
;
13 if (!shim
) return create
;
14 if (shim
.level
!== 1) return create
;
18 desc
= { configurable: false, enumerable: false, writable: true,
20 Object
.getOwnPropertyNames(Object
.prototype).forEach(function (name
) {
21 if (name
=== '__proto__') {
22 props
[name
] = { configurable: true, enumerable: false, writable: true,
28 Object
.defineProperties(nullObject
, props
);
30 Object
.defineProperty(shim
, 'nullPolyfill', { configurable: false,
31 enumerable: false, writable: false, value: nullObject
});
33 return function (prototype, props
) {
34 return create((prototype === null) ? nullObject : prototype, props
);