function F() {
return function() {
return {};
}
}
var f = new F();
f instanceof F; // returns false
As far as I understand, if I w
You could of course make all functions appear to be instanceof F by setting F.prototype = Function.prototype;.
Unfortunately it looks as if ECMAScript doesn't allow you to create a function subclass.
You can however do it in Gecko using the deprecated __proto__ property:
function F() {
function f() {
return {};
}
f.__proto__ = F.prototype;
return f;
}
F.prototype.__proto__ = F.__proto__;