15 Standard built-in Ecmascript objects

2010-07-03

Ecmascript has a few built-in objects. It all starts with the global object. All other objects start as properties of the global object. Note that objects like String and RegExp are built-in while any DOM object is NOT built-in.

The following descriptions apply only to built-in objects, functions and constructors defined by the specification (in the (sub-)paragraphs of chapter 15). They always apply unless specified otherwise.

Objects that implement [[Call]] will get [[Class]] set to "Function". All other objects get [[Class]] set to "Object". This means constructors that can not be called as a function get set to "Object" (see below).

All objects start with [[Extensible]] set to true.

Functions may not throw a TypeError simply for passing on more arguments than required by the specification. Passing on fewer arguments results in the missing arguments being assumed to be set to undefined.

Except for Object functions and constructors have the Function prototype object, which is the initial value of Function.prototype (15.2.4) for [[Prototype]].

No function that's not declared as a constructor has a [[Constructor]] property.

No function has a prototype.

The specification explicitly defines different behaviours for "called as a function" and "called as a constructor". The difference is the call with or without the new keyword (and the paranthesis of constructors are optional). When called as a function, the [[Call]] is invoked/defined. When called as a constructor, the [[Construct]] is invoked/defined.

All functions/constructors have a length property which is an integer type. The value is equal to the largest number of parameters declared by the specification, including optional parameters. This property has the following PD: {[[Writable]]:false, [[Enumerable]]:true, [[Configurable]]:true}.

All other properties described in this clause have PD{[[Writable]]:true, [[Enumerable]]:false, [[Configurable]]:true}.