All Downloads are FREE. Search and download functionalities are using the official Maven repository.

polyfills.Object.getOwnPropertyNames.meta.json Maven / Gradle / Ivy

The newest version!
{"aliases":["es5","modernizr:es5object","default-3.3","default-3.4","default-3.5","default-3.6","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","detectSource":"'getOwnPropertyNames' in Object","testSource":"","baseDir":"Object/getOwnPropertyNames","hasTests":true,"testsSource":"/* eslint-env mocha, browser*/\n/* global proclaim, it */\n\nit('returns properties of a simple object', function () {\n\tproclaim.deepEqual(Object.getOwnPropertyNames({foo:42}), [\"foo\"]);\n});\n\nit('does not throw an exception when used on window object', function () {\n\tproclaim.doesNotThrow(function () {\n\t\tObject.getOwnPropertyNames(window);\n\t});\n});\n\nit('does not include properties inherited from a prototype', function () {\n\tvar A = function() { this.foo = true; };\n\tA.prototype = {bar: true};\n\tvar a = new A();\n\tproclaim.deepEqual(Object.getOwnPropertyNames(a), [\"foo\"]);\n});\n\nit('throws an error when the arg is undefined or null', function() {\n\tproclaim.throws(function () {\n\t\tObject.getOwnPropertyNames(undefined);\n\t});\n\tproclaim.throws(function () {\n\t\tObject.getOwnPropertyNames(null);\n\t});\n});\n\n// This is the polyfill behaviour but the native impl in IE 9+ throws instead\nit.skip('returns an empty array for booleans and numbers', function() {\n\tproclaim.deepEqual(Object.getOwnPropertyNames(true), []);\n\tproclaim.deepEqual(Object.getOwnPropertyNames(42), []);\n});\n\n// This is the polyfill behaviour but the native impl in IE 9+ throws instead\nit.skip('splits a string into an array', function() {\n\n\t// In Chrome the length property is returned at the end, in FF at the beginning.  Our polyfill adds it to the end\n\tproclaim.deepEqual(Object.getOwnPropertyNames('foo'), ['0', '1', '2', 'length']);\n});"}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy