Scriptable

interface Scriptable(source)

The interface every JavaScript object implements.

KMP: getDefaultValue takes a KClass rather than a java.lang.Class. The hint is only ever compared by identity against the sentinels on ScriptRuntime, so the mapping is exact.

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val className: String

The class name, as Object.prototype.toString reports it.

Link copied to clipboard

[IsExtensible]. Legacy hosts remain extensible until they supply a different contract.

Link copied to clipboard
abstract var parentScope: Scriptable?
Link copied to clipboard
abstract var prototype: Scriptable?

Functions

Link copied to clipboard

[DefineOwnProperty], returning false when the host cannot make the requested definition. The legacy default supports its data-property attributes and refuses accessors or flags that put cannot represent. It does not add storage alongside the host's own properties.

Link copied to clipboard
abstract fun delete(index: Int)
abstract fun delete(name: String)
Link copied to clipboard
abstract fun get(index: Int, start: Scriptable): Any?

Gets an indexed property, or NOT_FOUND when there is none.

abstract fun get(name: String, start: Scriptable): Any?

Gets a named property, or NOT_FOUND when there is none.

Link copied to clipboard
abstract fun getDefaultValue(hint: KClass<*>?): Any?

Converts this object to a primitive, guided by hint.

Link copied to clipboard
abstract fun getIds(): Array<Any?>

Every property name of this object alone, ignoring the prototype chain.

Link copied to clipboard

[GetOwnProperty]. The legacy default describes a mutable, enumerable, configurable data property. Hosts with accessors or other attributes override this operation.

Link copied to clipboard
abstract fun has(index: Int, start: Scriptable): Boolean
abstract fun has(name: String, start: Scriptable): Boolean
Link copied to clipboard
abstract fun hasInstance(instance: Scriptable): Boolean

Backs the instanceof operator.

Link copied to clipboard
open fun ownPropertyKeys(): Array<Any?>

[OwnPropertyKeys], including non-enumerable names and symbols. Keys use the engine's String, Int-index or Symbol representation. The legacy default lists getIds.

Link copied to clipboard

[PreventExtensions]. A legacy host cannot enforce this through put, so it refuses.

Link copied to clipboard
abstract fun put(index: Int, start: Scriptable, value: Any?)
abstract fun put(name: String, start: Scriptable, value: Any?)
Link copied to clipboard
open fun setPrototypeOf(cx: Context, proto: Scriptable?): Boolean

[SetPrototypeOf], with extensibility and ordinary prototype-cycle checks.