1 // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
2 var anObject = require('./_an-object')
3 , dPs = require('./_object-dps')
4 , enumBugKeys = require('./_enum-bug-keys')
5 , IE_PROTO = require('./_shared-key')('IE_PROTO')
6 , Empty = function(){ /* empty */ }
7 , PROTOTYPE = 'prototype';
9 // Create object with fake `null` prototype: use iframe Object with cleared prototype
10 var createDict = function(){
11 // Thrash, waste and sodomy: IE GC bug
12 var iframe = require('./_dom-create')('iframe')
13 , i = enumBugKeys.length
17 iframe.style.display = 'none';
18 require('./_html').appendChild(iframe);
19 iframe.src = 'javascript:'; // eslint-disable-line no-script-url
20 // createDict = iframe.contentWindow.Object;
21 // html.removeChild(iframe);
22 iframeDocument = iframe.contentWindow.document;
23 iframeDocument.open();
24 iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
25 iframeDocument.close();
26 createDict = iframeDocument.F;
27 while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]];
31 module.exports = Object.create || function create(O, Properties){
34 Empty[PROTOTYPE] = anObject(O);
36 Empty[PROTOTYPE] = null;
37 // add "__proto__" for Object.getPrototypeOf polyfill
39 } else result = createDict();
40 return Properties === undefined ? result : dPs(result, Properties);