开发者

What's an "auto-casting bool"?

开发者 https://www.devze.com 2023-04-09 23:18 出处:网络
On the following answer to a previous question someone mentioned an \"auto-casting bool\" I guess null has an auto-casting bool开发者_JAVA百科 that is false.What is it, and what does the code that ma

On the following answer to a previous question someone mentioned an "auto-casting bool"

I guess null has an auto-casting bool开发者_JAVA百科 that is false. What is it, and what does the code that makes it look like?


The phrase "auto-casting bool" is a poor phrase someone used off hand. I believe what they mean is the internal ToBoolean operation

Of special note is the if statement which calls ToBoolean on the expression.

I don't know my way around the v8 source code but here is a search for ToBoolean on the v8 repo.

For reference v8 is the javascript implementation used by chrome and written in C++

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号