JSClass.resolve callback is called when a property is not found on an object. It can be used to implement lazy properties.
| || ||Pointer to the JS context in which the property access is taking place.|
| || ||Pointer to the object whose properties are being accessed.|
| || ||Name or index of the property being accessed.|
Resolve a lazy property named by
obj by defining it directly in
obj. Lazy properties are those reflected from some peer native property space (e.g., the DOM attributes for a given node reflected as
obj) on demand.
JS looks for a property in an object, and if not found, tries to resolve the given
id. After calling
resolve, the engine looks again to see if
obj[id]. If so, the property lookup succeeds. If not, the process is repeated with
The callback must return
JS_TRUE if the property is resolved, or if the object has no lazy property with the given
JS_FALSE to indicate any other error.
Classes with lazy properties that are enumerable should also implement the
JSNewResolveOp provides a cheaper way to resolve lazy properties.