Companion

object Companion

Properties

Link copied to clipboard
const val CONST: Int
Link copied to clipboard
const val DONTENUM: Int = 2

The property does not show up in a for..in loop.

Link copied to clipboard
const val EMPTY: Int = 0

The property has no special attributes.

Link copied to clipboard
const val PERMANENT: Int = 4

The property cannot be deleted.

Link copied to clipboard
const val READONLY: Int = 1

The property cannot be written to.

Link copied to clipboard
const val UNINITIALIZED_CONST: Int = 8

The const was declared but not yet given a value.

Functions

Link copied to clipboard
fun callMethod(cx: Context, obj: Scriptable, methodName: String, args: Array<Any?>): Any?
Link copied to clipboard
fun <T : ScriptableObject> defineBuiltInProperty(owner: T, name: Any?, attributes: Int, getter: BuiltInSlot.Getter<T>)
fun <T : ScriptableObject> defineBuiltInProperty(owner: T, name: String, attributes: Int, getter: BuiltInSlot.Getter<T>, setter: BuiltInSlot.Setter<T>)
fun <T : ScriptableObject> defineBuiltInProperty(owner: T, name: Any?, attributes: Int, getter: BuiltInSlot.Getter<T>, setter: BuiltInSlot.Setter<T>, attrSetter: BuiltInSlot.AttributeSetter<T>)
fun <T : ScriptableObject> defineBuiltInProperty(owner: T, name: String, attributes: Int, getter: BuiltInSlot.Getter<T>, setter: BuiltInSlot.Setter<T>, attrSetter: BuiltInSlot.AttributeSetter<T>, propDescSetter: BuiltInSlot.PropDescriptionSetter<T>)
Link copied to clipboard
fun defineConstProperty(destination: Scriptable, propertyName: String)
Link copied to clipboard
fun defineProperty(destination: Scriptable, propertyName: String, value: Any?, attributes: Int)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun <T : Any> ensureType(obj: Any?, functionName: String): T

Checks that obj is a T, and says which function complained if it is not.

Link copied to clipboard
Link copied to clipboard
fun getClassPrototype(scope: Scriptable, className: String): Scriptable?
Link copied to clipboard
fun getDefaultValue(obj: Scriptable, typeHint: KClass<*>?): Any?

OrdinaryToPrimitive: tries toString and valueOf in the order the hint asks for, and takes the first one that gives back a primitive.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun getProperty(obj: Scriptable, key: Symbol): Any?
fun getProperty(obj: Scriptable, index: Int): Any?
fun getProperty(obj: Scriptable, name: String): Any?
Link copied to clipboard

Every property name on obj and everything in its prototype chain, without repeats.

Link copied to clipboard
fun getSuperProperty(superObj: Scriptable, thisObj: Scriptable, key: Symbol): Any?
fun getSuperProperty(superObj: Scriptable, thisObj: Scriptable, index: Int): Any?
fun getSuperProperty(superObj: Scriptable, thisObj: Scriptable, name: String): Any?
Link copied to clipboard

Walks up the parent scopes to the global object.

Link copied to clipboard
fun getTopScopeValue(scope: Scriptable, key: Any): Any?

The value parked under key on the nearest scope in the chain that has one.

Link copied to clipboard
Link copied to clipboard
fun putConstProperty(obj: Scriptable, name: String, value: Any?)
Link copied to clipboard
fun putProperty(obj: Scriptable, key: Symbol, value: Any?)
fun putProperty(obj: Scriptable, index: Int, value: Any?)
fun putProperty(obj: Scriptable, name: String, value: Any?)
Link copied to clipboard
fun putSuperProperty(superObj: Scriptable, thisObj: Scriptable, key: Symbol, value: Any?)
fun putSuperProperty(superObj: Scriptable, thisObj: Scriptable, index: Int, value: Any?)
fun putSuperProperty(superObj: Scriptable, thisObj: Scriptable, name: String, value: Any?)
Link copied to clipboard
fun redefineProperty(obj: Scriptable, name: String, isConst: Boolean)