NativeInt32Array

The Int32Array view: 4 bytes per element.

Constructors

Link copied to clipboard
constructor()
constructor(ab: NativeArrayBuffer, off: Int, len: Int)
constructor(len: Int)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val allIds: Array<Any?>

Every property, enumerable or not.

Link copied to clipboard
open override val arrayLength: Int

How many elements there are.

Link copied to clipboard
Link copied to clipboard

How much of the buffer the view covers, in bytes. Upstream's getByteLength.

Link copied to clipboard
open override val bytesPerElement: Int
Link copied to clipboard
open override val className: String

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

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val isExtensible: Boolean

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

Link copied to clipboard

True when the view has no length of its own and covers its resizable buffer from offset to the end, however the buffer grows or shrinks.

Link copied to clipboard
Link copied to clipboard
val offset: Int

Where in the buffer the view starts, in bytes. Upstream's getByteOffset.

Link copied to clipboard
open override var parentScope: Scriptable?
Link copied to clipboard
open override var prototype: Scriptable?
Link copied to clipboard
open val typeOf: String

What typeof says about this object.

Functions

Link copied to clipboard
fun associateValue(key: Any, value: Any): Any

Parks value under key, or returns what is already there.

Link copied to clipboard

True for an object that has to pretend it is undefined, which only NativeWith does.

Link copied to clipboard
fun defineBuiltinProperty(scope: Scriptable, name: String, length: Int, target: SerializableCallable, attributes: Int = DONTENUM, propertyAttributes: Int = DONTENUM or READONLY)

Same as above for a built-in method, which does not get a prototype property.

Link copied to clipboard
open override fun defineConst(name: String, start: Scriptable)
Link copied to clipboard
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
fun defineProperty(key: Symbol, value: Any?, attributes: Int)
fun defineProperty(propertyName: String, value: Any?, attributes: Int)

fun defineProperty(name: String, getter: () -> Any??, setter: (Any?) -> Unit?, attributes: Int)

Defines a property whose value comes from a lambda that needs nothing but itself.

fun defineProperty(scope: Scriptable, name: String, length: Int, target: SerializableCallable, attributes: Int = DONTENUM, propertyAttributes: Int = DONTENUM or READONLY)

Defines a method backed by a Kotlin lambda.

Link copied to clipboard
open override fun delete(key: Symbol)
open override fun delete(index: Int)
open override fun delete(name: String)
Link copied to clipboard
operator fun get(key: Any?): Any?
open override fun get(key: Symbol, start: Scriptable): Any?

open override fun get(index: Int, start: Scriptable): Any?

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

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

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

Link copied to clipboard
open override fun getArrayElement(index: Int): Any?

The element at index. It has to be a type script understands: a number, a string or a Scriptable. Never called with an out-of-range index.

Link copied to clipboard

A value another part of the engine parked on this object under key.

Link copied to clipboard
open fun getAttributes(sym: Symbol): Int
open fun getAttributes(index: Int): Int
open fun getAttributes(name: String): Int
Link copied to clipboard
open override fun getDefaultValue(hint: KClass<*>?): Any?

Converts this object to a primitive, guided by hint.

Link copied to clipboard
fun getGetterOrSetter(name: String?, index: Int, scope: Scriptable, isSetter: Boolean): Any?
Link copied to clipboard
open override 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
open override fun has(key: Symbol, start: Scriptable): Boolean
open override fun has(index: Int, start: Scriptable): Boolean
open override fun has(name: String, start: Scriptable): Boolean
Link copied to clipboard
open override fun hasInstance(instance: Scriptable): Boolean

What instanceof asks once this object has no Symbol.hasInstance, which ScriptRuntime.instanceOf has already looked for: OrdinaryHasInstance for something that can be called, and a TypeError for anything else. Upstream looked the method up again here and called it with this object as its argument in place of instance, and walked instance's chain for this object itself rather than for its prototype.

Link copied to clipboard
open override fun isConst(name: String): Boolean
Link copied to clipboard
open fun isEmpty(): Boolean
Link copied to clipboard
open override 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
open override fun preventExtensions(): Boolean

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

Link copied to clipboard
open override fun put(key: Symbol, start: Scriptable, value: Any?)
open override fun put(name: String, start: Scriptable, value: Any?)

open override fun put(index: Int, start: Scriptable, value: Any?)

[Set] for an index: written here when this view is the receiver, which converts the value even when the index is out of range, and otherwise an ordinary property of the receiver, made only when the index is valid here.

Link copied to clipboard
open override fun putConst(name: String, start: Scriptable, value: Any?)
Link copied to clipboard

Seals the object, so no property can be added, removed or changed.

Link copied to clipboard
open override fun setArrayElement(index: Int, value: Any?)

Writes value at index. Never called with an out-of-range index. The implementation checks the type of value and converts it if it has to.

Link copied to clipboard
fun setAttributes(key: Symbol, attributes: Int)
fun setAttributes(index: Int, attributes: Int)
open fun setAttributes(name: String, attributes: Int)
Link copied to clipboard

Attaches data that lives outside the engine, or detaches it with null.

Link copied to clipboard
fun setGetterOrSetter(name: Any?, index: Int, getterOrSetter: Callable?, isSetter: Boolean)
Link copied to clipboard
open override fun setPrototypeOf(cx: Context, proto: Scriptable?): Boolean

[SetPrototypeOf] as the spec states it, answering whether the prototype was set: OrdinarySetPrototypeOf (ES 10.1.2.1), whose cycle check walks [Prototype] directly and stops at an object with its own [GetPrototypeOf], a proxy, without calling into it; and for %Object.prototype%, an immutable prototype exotic object, SetImmutablePrototype (ES 10.4.7). Upstream threw from inside the check, walked through a proxy's getPrototypeOf trap, and let Object.prototype take a new prototype.

Link copied to clipboard
open fun size(): Int

Part of what java.util.Map needs. NativeObject finishes the job.