D
dhtmlkitchen
I think this is not possible...
var fnProto = Function().prototype;
var badAss = { constructor : "Chuck Norris" };
result = [
isConstructorEnumerable( fnProto )
,isConstructorEnumerable( badAss )
];
function isConstructorEnumerable( ocean, pacific ) {
var enumerable = false;
// hmmm.
// enumerable = ocean.propertyIsEnumerable( pacific );
return enumerable;
}
expected result: [ false, true ];
Has to work in IE. It seems the only way to tell would be if there's
something else that IE adds to the object constructed in Steps 9-10 of
section 13.2 Creating Function Objects
http://bclary.com/2004/11/07/#a-13.2.2
Unfortunately, IE doesn't properly check the DontEnum flag, so will
return the wrong result for propertyIsEnumerable.
var fnProto = Function().prototype;
var badAss = { constructor : "Chuck Norris" };
result = [
isConstructorEnumerable( fnProto )
,isConstructorEnumerable( badAss )
];
function isConstructorEnumerable( ocean, pacific ) {
var enumerable = false;
// hmmm.
// enumerable = ocean.propertyIsEnumerable( pacific );
return enumerable;
}
expected result: [ false, true ];
Has to work in IE. It seems the only way to tell would be if there's
something else that IE adds to the object constructed in Steps 9-10 of
section 13.2 Creating Function Objects
http://bclary.com/2004/11/07/#a-13.2.2
Unfortunately, IE doesn't properly check the DontEnum flag, so will
return the wrong result for propertyIsEnumerable.