Closed Raynos closed 12 years ago
bound = function () { return self.apply( nop.prototype && this instanceof nop ? this : ( obj || {} ), args.concat( slice.call(arguments) ) ); };
http://es5.github.com/#x15.3.4.5
Set the [[Construct]] internal property of F as described in 15.3.4.5.2.
http://es5.github.com/#x15.3.4.5.2
Return the result of calling the [[Construct]] internal method oftarget providing args as the arguments.
http://es5.github.com/#x13.2.2
Return obj.
Basically your code always returns the return value of the bound function and doesn't handle cases like
new ( (function () { return undefined; }).bind(lulz, args) ) !== undefined;
Here the return value of invoking new (and [[Construct]]) on the bound function should be that the new instance is returned, not the return value of the bound function.
new
[[Construct]]
Again see es5-shim for implementation.
Included in the latest version
http://es5.github.com/#x15.3.4.5
http://es5.github.com/#x15.3.4.5.2
http://es5.github.com/#x13.2.2
Basically your code always returns the return value of the bound function and doesn't handle cases like
Here the return value of invoking
new
(and[[Construct]]
) on the bound function should be that the new instance is returned, not the return value of the bound function.Again see es5-shim for implementation.