8.6.2.1 For some objects

2010-04-18

These properties exist for some objects.

Name: [[PrimitiveValue]]
Type: primitive
Description: Of the built-in objects, only Boolean, Date, Number and String implement it. Holds the primitive value for this object.

Name: [[Construct]]
Function: [[Construct]](list of any)
Return: Object
Description: Creates a new object. Called by using the keyword "new" in front of a function. Will return a new object by the type of the function. The "this" value will resolve to the new object. If the constructor at any point returns an object, that object will be returned by the constructor. For any other value returned (even none), a new object of constructor type will be returned and instanceof constructor will return true. Of the built-in objects only Function implements [[Construct]]. It is defined as the body of a function (calling a function with or without new executes the same code, except "this" will refer differently). Objects that implement [[Construct]] are "constructors".

Name: [[Call]]
Function: [[Call]](any, list of any)
Return: any or Reference
Description: Execute code associated by the object. Only Function objects implement [[Call]]. Invoked through function call expression, the parenthesis. Objects that have it are "callable". Only callable host objects may return a Reference value. Of the built-in types, only Function implements [[Call]].

Name: [[HasInstance]]
Function: [[HasInstance]](any)
Return: Boolean
Description: Returns true when the parameter is likely an object constructed by this constructor. Of the built-in types, only Function implements [[HasInstance]].

Name: [[Scope]]
Type: Lexical Environment
Description: Defines the context in which this function is executing. Of the built-in types, only Function implements [[Scope]].

Name: [[FormalParameters]]
Type: list of Strings
Description: A possibly empty list of the names of the formal parameters of a function. Used for Arguments. Of the built-in types, only Function implements [[FormalParameters]].

Name: [[Code]]
Type: ECMAScript code
Description: The body of a function. This is what [[Call]] and/or [[Construct]] actually execute. In most implementations, for user defined functions, this can be gotten through the .toString method. Of the built-in types, only Function implements [[Code]].

Name: [[TargetFunction]]
Type: Object
Description: The target function of a function created using the Function.prototype.bind method. So when this function is called, it actually calls [[TargetFunction]]. Of the built-in types, only Function implements [[TargetFunction]].

Name: [[BoundThis]]
Type: any
Description: The bound "this" value of a function object created using the Function.prototype.bind method. So when this function executes, the "this" will always be [[BoundThis]]. Of the built-in types, only Function implements [[BoundThis]].

Name: [[BoundArguments]]
Type: list of any
Description: Bound arguments for this function. So when this function is called, the [[TargetFunction]] is called with at least these parameters. Any other parameters supplied are appended to the list. This function is returned by the Function.prototype.bind method. Of the built-in types, only Function implements[[BoundArguments]].

Name: [[Match]]
Function: [[Match]](str:String, index:int)
Return: MatchResult
Description: Tests for a regular expression match and returns a MatchResult value (15.10.2.1). Of the built-in types, only RegExp implements [[Match]].

Name: [[ParameterMap]]
Type: Object
Description: Provides a mapping between parameter arguments and the properties of the Arguments object. Only the arguments objects have a [[ParameterMap]] property.