Internal Method (Definition)

ECMAScript describes internal methods that are private.

Availability:

ECMAScript edition - 2

Internal methods are not exposed to the programmer using ECMA compliant JavaScript. However, some implementations may allow you to view them through a debugging interface. The reserved words suggest that at least some of these internal methods may be made visible at a later stage of the language development.

Run time errors may be generated due to faults in the interpreter logic trying to access internal methods that do not exist.

PropertyParametersDescription
CallA list of argument valuesThis method executes some code associated with the object via a function call mechanism. Objects that implement this internal method are called functions.
CanPutA property nameReturns a Boolean value indicating whether you can put values into the named property.
ClassnoneA string value describing what kind of object this is.
ConstructA list of argument valuesThis constructs an object and is normally invoked by the new operator. Objects that implement this internal method are called constructors.
DefaultValueA hint valueReturns a default value for the object which should be a primitive value and not an object or a reference to one.
DeleteA property nameRemoves the specified property from the object.
GetA property nameThis method returns the value of the named property.
HasInstanceA valueReturns a Boolean value indicating whether there is an instance. This only applies to Function objects.
HasPropertyA property nameReturns a Boolean value indicating whether that property is available as a member of this object.
MatchA string and an indexTests for a regular expression and returns a match result.
PrototypenoneReturns the prototype of this object.
PutA property name and a valueThis method stores the value in the named property.
ScopenoneA scope chain for the Function object to be executed in.
ValuenoneInternal state information associated with this object.

The table describes the base set of ECMA compliant internal methods. Hosted implementations may add to these and implement special methods in any way they need to, however they are not required to implement all of these methods.

Every object must implement the Get, Put, HasProperty, Delete and DefaultValue functions. This also applies to host objects. Note that the DefaultValue method may for some objects generate a run-time error.

ECMA edition 3 introduces the following internal methods/properties:

See also:Call, CanPut(), Construct, DefaultValue(), Delete(), Get(), HasProperty(), Internal function, Internal Property, Object, Put()

Cross-references:

ECMA 262 edition 2 - section - 8.6.2

ECMA 262 edition 3 - section - 8.6.2