What's an "auto-casting bool"?
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++
精彩评论