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.
| Property | Parameters | Description |
|---|---|---|
| Call | A list of argument values | This method executes some code associated with the object via a function call mechanism. Objects that implement this internal method are called functions. |
| CanPut | A property name | Returns a Boolean value indicating whether you can put values into the named property. |
| Class | none | A string value describing what kind of object this is. |
| Construct | A list of argument values | This constructs an object and is normally invoked by the new operator. Objects that implement this internal method are called constructors. |
| DefaultValue | A hint value | Returns a default value for the object which should be a primitive value and not an object or a reference to one. |
| Delete | A property name | Removes the specified property from the object. |
| Get | A property name | This method returns the value of the named property. |
| HasInstance | A value | Returns a Boolean value indicating whether there is an instance. This only applies to Function objects. |
| HasProperty | A property name | Returns a Boolean value indicating whether that property is available as a member of this object. |
| Match | A string and an index | Tests for a regular expression and returns a match result. |
| Prototype | none | Returns the prototype of this object. |
| Put | A property name and a value | This method stores the value in the named property. |
| Scope | none | A scope chain for the Function object to be executed in. |
| Value | none | Internal 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:
HasInstance
Scope
Match
| See also: | Call, CanPut(), Construct, DefaultValue(), Delete(), Get(), HasProperty(), Internal function, Internal Property, Object, Put() |
| Prev | Home | Next |
| Internal function | Up | Internal Property |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. | ||