4.3 Terms and definitions 名稱與定義
- 詳細內容
- 分類:ECMA-262 第五版
- 發佈:2013-04-10, 週三 19:49
- 點擊數:1890
4.3 Terms and definitions
For the purposes of this document, the following terms and definitions apply.
4.3.1
type
set of data values as defined in Clause 8 of this specification
4.3.2
primitive value
member of one of the types Undefined, Null, Boolean, Number, or String as defined in Clause 8
NOTE A primitive value is a datum that is represented directly at the lowest level of the language implementation.
4.3.3
object
member of the type Object
NOTE An object is a collection of properties and has a single prototype object. The prototype may be the null value.
4.3名稱與定義
下面的名稱與定義適用於這文件的議題。
4.3.1
類型
在本規範書條款8中所定義的資料值組。
4.3.2
原始值
下面的類型中的一種,Undefined, Null, Boolean, Number,String,這些類型定義在條款8。
注意,原始值是在語言實現的最低層表示的數據。
4.3.3
物件
類型(4.3.1)物件中的成員
注意,物件是屬性的集合,並且擁有單一的原型物件。原型可能是null。
4.3.4
constructor
function object that creates and initialises objects
NOTE The value of a constructor‘s "prototype" property is a prototype object that is used to implement inheritance and shared properties.
4.3.5
prototype
object that provides shared properties for other objects
NOTE When a constructor creates an object, that object implicitly references the constructor‘s "prototype" property for the purpose of resolving property references. The constructor‘s "prototype" property can be referenced by the program expression constructor.prototype, and properties added to an object‘s prototype are shared, through inheritance, by all objects sharing the prototype. Alternatively, a new object may be created with an explicitly specified prototype by using the Object.create built-in function.
4.3.6
native object
object in an ECMAScript implementation whose semantics are fully defined by this specification rather than by the host environment
NOTE Standard 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.4
建構子
能夠建立並且初始化物件的函式物件。
注意,建構子的"prototype"屬性是一個原型物件,此原型物件用來實現繼承以及分享屬性。
4.3.5
原型
原型是能提供分享屬性給其他物件的物件。
注意,當建構子建立了一個物件時,為了解決屬性參考的目的,該物件隱式的參考到建構子的"原型"屬性。建構子的"原型"屬性可以被程式表達式constructor.prototype參考到,並且加到物件原型的屬性是透過繼承被所有共享該原型的物件所分享的。另外,新的物件也可以使用內建函式Object.create顯示的指定原型來建立。
4.3.6
原生物件
語義被此份規格書完整定義的ECMAsScript實作介面的物件,而不是主機環境定義的物件。
注意,標準的原生物件是定義在此份規格書中,一些原生物件是內建的,其他的可能是在ECMAScript 程式執行過程當中建立。
按個讚!~支持本站!~
FB推薦載入中