Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Partial non-enumerable implementation
/* partial non-enumerable property implementation
Adds a flag to a weakmap saying on obj foo property bar is not enumerable.
Then checks that flag in Object.keys emulation.
*/
// pd.Name :- https://github.com/Raynos/pd#pd.Name
var enumerables = pd.Name();
Object.defineProperty = function (obj, name, prop) {
if (prop.enumerable === false) {
enumerables(obj)[name] = true;
}
...
};
Object.keys = function (obj) {
var enumerabilityHash = enumerables(obj), keys = [];
for (var k in obj) {
if (obj.hasOwnProperty(k) && !enumerabilityHash[k]) {
keys.push(k);
}
}
return keys;
};
Object.getOwnPropertyNames = function (obj) {
var keys = [];
for (var k in obj) {
if (obj.hasOwnProperty(k)) {
keys.push(k);
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.