Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#463·es5-shim

Why not set bound.prototype = target.prototype directly?

Author: LongTengDaoCreated Jun 25, 2019Updated Jun 26, 2019

https://github.com/es-shims/es5-shim/blob/d5297adf9a9ca5669b3d43153fa2d8092e879f9c/es5-shim.js#L307

javascript
function f () {}
var b = f.bind({});
new f instanceof b;// true in native, but false in shim

Source: es-shims/es5-shim

View original on GitHubView discussion on GitHub