15.2.4.7 Object.prototype.propertyIsEnumerable(V)

2010-07-04

boolean Object.prototype.propertyIsEnumerable(V:string|mixed)

Returns this[V].[[Enumerable]], coercing V to a string and this to an object. Always returns false if this does not have a property V.

Code: (Meta Ecma)
Object.prototype.propertyIsEnumerable = function(V){
var P = ToString(V);
var O = ToObject(this);
var desc = O.[[GetOwnProperty]](P);
if (!desc) return false;
return desc.[[Enumerable]];
}

Note that P is converted to String first so as to maintain the behaviour of previous specifications when an error is thrown.