BuiltInSlot

A Slot for a property of a built-in object that gets created very often. It exposes a field on a native object through plain functions, and lets the owner take over attribute changes and redefinition (array length behaves unusually on both counts).

The descriptor it produces is a plain data descriptor, because the properties worth putting here do not necessarily have getter and setter functions.

The owner is held in the slot's value field, which a built-in slot never uses for a real value. That is a deliberate trade: the slot API does not pass the owning map's owner in, and keeping it here avoids allocating anything per access.

Types

Link copied to clipboard

Changes a built-in property's attributes.

Link copied to clipboard
object Companion
Link copied to clipboard
fun interface Getter<U : ScriptableObject>

Reads a built-in property.

Link copied to clipboard

Redefines a built-in property from a descriptor.

Link copied to clipboard
fun interface Setter<U : ScriptableObject>

Writes a built-in property, answering whether the write was accepted.

Functions

Link copied to clipboard
open override fun getValue(start: Scriptable?): Any?
Link copied to clipboard
open override fun setValue(value: Any?, owner: Scriptable, start: Scriptable, isThrow: Boolean): Boolean
fun setValue(value: Any?, owner: Scriptable, start: Scriptable): Boolean
Link copied to clipboard
fun setValueFromDescriptor(value: Any?, owner: Scriptable, start: Scriptable, isThrow: Boolean)

Writing through a property descriptor skips the readonly check, so it gets its own path.