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);