NativeRegExp

The RegExp object: a bytecode compiler for the pattern plus a backtracking matcher that runs it.

Nothing here calls a platform regex engine. The pattern is compiled to Rhino's own bytecode and matched by executeREBytecode, so JVM, JS, iOS and Wasm all answer the same thing.

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 className: String

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

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

What typeof says about this object.

Functions

Link copied to clipboard
fun activatePrototypeMap(maxPrototypeId: Int)
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
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(name: String)
open override fun delete(index: Int)
Link copied to clipboard
open override fun execIdCall(f: IdFunctionObject, cx: Context, scope: Scriptable, thisObj: Scriptable?, args: Array<Any?>): Any?

thisObj is null when called as a constructor, and then the result has to be a Scriptable.

Link copied to clipboard
fun exportAsJSClass(maxPrototypeId: Int, scope: Scriptable?, sealed: Boolean): IdFunctionObject
Link copied to clipboard
open override fun get(key: Symbol, start: Scriptable): Any?
operator fun get(key: Any?): Any?

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

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

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

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

Link copied to clipboard

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

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

Backs the instanceof operator.

Link copied to clipboard
Link copied to clipboard
fun initPrototypeMethod(tag: Any?, id: Int, name: String, arity: Int): IdFunctionObject
fun initPrototypeMethod(tag: Any?, id: Int, key: Symbol, functionName: String, arity: Int): IdFunctionObject
fun initPrototypeMethod(tag: Any?, id: Int, propertyName: String, functionName: String?, arity: Int): IdFunctionObject
fun initPrototypeMethod(tag: Any?, id: Int, key: Symbol, functionName: String, arity: Int, attributes: Int): IdFunctionObject
Link copied to clipboard
fun initPrototypeValue(id: Int, key: Symbol, value: Any?, attributes: Int)
fun initPrototypeValue(id: Int, name: String, value: Any?, attributes: Int)
Link copied to clipboard
open override fun isConst(name: String): Boolean
Link copied to clipboard
open fun isEmpty(): Boolean
Link copied to clipboard
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?)
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 setAttributes(name: String, attributes: Int)
fun setAttributes(key: Symbol, attributes: Int)
fun setAttributes(index: Int, 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 fun size(): Int

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

Link copied to clipboard
open override fun toString(): String