本地对象,内置对象,宿主对象

来源:互联网 发布:羽绒服 时尚 知乎 编辑:程序博客网 时间:2024/05/17 18:48

4.3.6native object

object in an ECMAScript implementation whose semantics are fully defined by this specification rather than by the host environment

NOTEStandard native objects are defined in this specification. Some native objects are built-in; others may be constructed during the course of execution of an ECMAScript program.

4.3.7built-in object

object supplied by an ECMAScript implementation, independent of the host environment,that is present at the start of the execution of an ECMAScript program

NOTEStandard built-in objects are defined in this specification, and an ECMAScript implementation may specify and define others. Every built-in object is a native object. A built-in constructor is a built-in object that is also a constructor.

4.3.8host object

object supplied by the host environment to complete the execution environment of ECMAScript

NOTEAny object that is not native is a host object.


以上是标准文档所描述


本人理解:

Native Object:像Object,Function,Array,Date等,在chrome调试器中打印如:


buid-in Object:像全局对象和Math这种不属性BOM或者DOM对象的为内置对象:



host object :像这种BOM和DOM这种由浏览器实现为宿主对象。


有个疑问:我们自定义的对象,属于host对象吗?

我觉得不是,因为host对象由host环境提供。不知道对不对,请知道的朋友分析下。


0 0