Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

第二章:this .... 中关于bind的polyfill有些问题 #7

Open
xusanduo08 opened this issue Aug 13, 2019 · 0 comments
Open

第二章:this .... 中关于bind的polyfill有些问题 #7

xusanduo08 opened this issue Aug 13, 2019 · 0 comments

Comments

@xusanduo08
Copy link

文章中,bind的polyfill中判断bind返回的方法是否被用作构造函数时用到的方法如下:

this instanceof fNOP && oThis ? this : oThis

私以为,此处不需要再判断oThis是否存在,直接

this instanceof fNOP ? this : oThis

即可。
毕竟bind的第一个参数可以传入null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant