[英]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 that is false. 我猜null具有错误的自动转换布尔值。 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 我相信它们的意思是内部
ToBoolean
操作
Of special note is the if statement which calls ToBoolean
on the expression. 需要特别注意的是if语句 ,该表达式在表达式上调用
ToBoolean
。
I don't know my way around the v8 source code but here is a search for ToBoolean
on the v8 repo . 我不知道如何处理v8源代码,但这是在v8
ToBoolean
上搜索ToBoolean
的 。
For reference v8 is the javascript implementation used by chrome and written in C++ 供参考,v8是chrome使用并以C ++编写的javascript实现
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.