polyfill-service
Version:
A polyfill combinator
1 lines • 1.7 kB
JSON
{"aliases":["es5","modernizr:es5object","default"],"browsers":{"firefox":"3.6","safari":"4","ie":"6 - 8","firefox_mob":"3.6"},"docs":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames","baseDir":"Object/getOwnPropertyNames","hasTests":true,"rawSource":"\n// Object.getOwnPropertyNames\nObject.getOwnPropertyNames = function getOwnPropertyNames(object) {\n\tvar buffer = [];\n\tvar key;\n\n\t// Non-enumerable properties cannot be discovered but can be checked for by name.\n\t// Define those used internally by JS to allow an incomplete solution\n\tvar commonProps = ['length', \"name\", \"arguments\", \"caller\", \"prototype\", \"observe\", \"unobserve\"];\n\n\tif (typeof object === 'undefined' || object === null) {\n\t\tthrow new TypeError('Cannot convert undefined or null to object');\n\t}\n\n\tobject = Object(object);\n\n\t// Enumerable properties only\n\tfor (key in object) {\n\t\tif (Object.prototype.hasOwnProperty.call(object, key)) {\n\t\t\tbuffer.push(key);\n\t\t}\n\t}\n\n\t// Check for and add the common non-enumerable properties\n\tfor (var i=0, s=commonProps.length; i<s; i++) {\n\t\tif (commonProps[i] in object) buffer.push(commonProps[i]);\n\t}\n\n\treturn buffer;\n};\n","minSource":"Object.getOwnPropertyNames=function(e){var n,r=[],t=[\"length\",\"name\",\"arguments\",\"caller\",\"prototype\",\"observe\",\"unobserve\"];if(\"undefined\"==typeof e||null===e)throw new TypeError(\"Cannot convert undefined or null to object\");e=Object(e);for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.push(n);for(var o=0,l=t.length;l>o;o++)t[o]in e&&r.push(t[o]);return r};","detectSource":"'getOwnPropertyNames' in Object"}