CanPut() (Function/internal)

Internal private function.

Availability:

ECMAScript edition - 2

This internal function returns a Boolean value to indicate whether the named property can be changed in the containing object.

If the property is found, the value of its ReadOnly attribute is checked. If it has a ReadOnly attribute, the result of CanPut() must be false. Otherwise, having found the property, the true result will be returned.

If the property does not exist in the receiving object, the prototype chain is walked until the property or a null prototype is encountered. At each inheritance level, the CanPut() function is used to determine the existence of the property.

If a null prototype is encountered, the result will be true, since the property can then be created in the original receiving object.

If the prototype is a host object that does not implement the CanPut() function, then false is returned as a result.

Because the prototype chain is walked extensively by the CanPut() function, if the prototype chain is not finite and terminated with a null at some stage, a recursive loop is built and the function never returns.

See also:Internal Method

Property attributes:

Internal.

Cross-references:

ECMA 262 edition 2 - section - 8.6.2.3

ECMA 262 edition 3 - section - 8.6.2.3