简体   繁体   English

什么是“自动浇铸布尔”?

[英]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.

相关问题 检测或阻止JavaScript中的自动转换? - Detect or prevent auto casting in JavaScript? JQuery相当于脚本/原型的自动完成功能是什么? - What is JQuery's equivalent of scriptaculous/prototype's auto-complete? 在JavaScript中执行自动建议文本字段的最简单方法是什么? - What's the simplest way of doing an auto suggest textfield in JavaScript? 这个转换错误与_id有什么关系? 路径“ _id”上的值“ 123”的“ Cast to ObjectId失败” - What's this casting error has to do with _id? “Cast to ObjectId failed for value ”123“ at path ”_id"' 将div向下滑动的“ height:auto”技巧是什么 - What's the “height:auto” trick to sliding a div down JCarousellite无法自动滚动-不知道出了什么问题 - JCarousellite not auto-scrolling - no clue what's wrong 模拟铸造的好方法是什么? - What is a good way to emulate casting? 根据Google的JavaScript样式指南,可以将哪些IDE配置为自动格式化JavaScript? - What IDE's can be configured to auto-format JavaScript according to Google's JavaScript Style Guide? 从布尔运算符“转换”返回的目的是什么? - What is the purpose of “casting” the return from a Boolean operator? 使用Visual Studio的JavaScript IntelliSense模仿Casting - Mimicking Casting with Visual Studio's JavaScript IntelliSense
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM