Sha256: 6989db3d869b42e62ff149fa26a54aa5d3dd92d0adae8a3087514607f6185b67

Contents?: true

Size: 1.08 KB

Versions: 65

Compression:

Stored size: 1.08 KB

Contents

if (!Object.keys) {
    Object.keys = (function () {
        var hasOwnProperty = Object.prototype.hasOwnProperty,
            hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
            dontEnums = [
                'toString',
                'toLocaleString',
                'valueOf',
                'hasOwnProperty',
                'isPrototypeOf',
                'propertyIsEnumerable',
                'constructor'
            ],
            dontEnumsLength = dontEnums.length;

        return function (obj) {
            if (typeof obj !== 'object' && typeof obj !== 'function' || obj === null) throw new TypeError('Object.keys called on non-object');

            var result = [];

            for (var prop in obj) {
                if (hasOwnProperty.call(obj, prop)) result.push(prop);
            }

            if (hasDontEnumBug) {
                for (var i=0; i < dontEnumsLength; i++) {
                    if (hasOwnProperty.call(obj, dontEnums[i])) result.push(dontEnums[i]);
                }
            }
            return result;
        }
    })()
};

Version data entries

65 entries across 65 versions & 3 rubygems

Version Path
constructor-cms-0.6.4 core/app/assets/javascripts/constructor_core/keys_snippet.js
constructor-core-0.6.3 app/assets/javascripts/constructor_core/keys_snippet.js
constructor-cms-0.6.3 core/app/assets/javascripts/constructor_core/keys_snippet.js
constructor-core-0.6.2 app/assets/javascripts/constructor_core/keys_snippet.js
constructor-cms-0.6.2 core/app/assets/javascripts/constructor_core/keys_snippet.js
constructor-core-0.6.1 app/assets/javascripts/constructor_core/keys_snippet.js
constructor-cms-0.6.1 core/app/assets/javascripts/constructor_core/keys_snippet.js
constructor-core-0.6.0 app/assets/javascripts/constructor_core/keys_snippet.js
constructor-cms-0.6.0 core/app/assets/javascripts/constructor_core/keys_snippet.js
constructor-core-0.5.8 app/assets/javascripts/constructor_core/keys_snippet.js
constructor-cms-0.5.8 core/app/assets/javascripts/constructor_core/keys_snippet.js
constructor-core-0.5.7 app/assets/javascripts/constructor_core/keys_snippet.js
constructor-core-0.5.6 app/assets/javascripts/constructor_core/keys_snippet.js
constructor-core-0.5.5 app/assets/javascripts/constructor_core/keys_snippet.js
constructor-core-0.5.4 app/assets/javascripts/constructor_core/keys_snippet.js
constructor-core-0.5.3 app/assets/javascripts/constructor_core/keys_snippet.js
constructor-core-0.5.2 app/assets/javascripts/constructor_core/keys_snippet.js
constructor-core-0.5.1 app/assets/javascripts/constructor_core/keys_snippet.js
constructor-core-0.5.0 app/assets/javascripts/constructor_core/keys_snippet.js
constructor-core-0.4.0 app/assets/javascripts/constructor_core/keys_snippet.js