Reflect

object Reflect
class Object
trait Matchable
class Any

Value members

Concrete methods

@inline
def apply(target: Function, thisArgument: Any, argumentsList: ArrayLike[Any]): Any

Calls the function with the specified object as the this value and the elements of specified array as the arguments.

Calls the function with the specified object as the this value and the elements of specified array as the arguments.

Value Params
argumentsList

An array of argument values to be passed to the function.

target

The function to call.

thisArgument

The object to be used as the this object.

@inline
def construct(target: Function, argumentsList: ArrayLike[Any]): Any

Constructs the target with the elements of specified array as the arguments and the specified constructor as the new.target value.

Constructs the target with the elements of specified array as the arguments and the specified constructor as the new.target value.

Value Params
argumentsList

An array of argument values to be passed to the constructor.

newTarget

The constructor to be used as the new.target object.

target

The constructor to invoke.

@inline
def construct(target: Function, argumentsList: ArrayLike[Any], newTarget: Function): Any
@inline
def defineProperty(target: Object, propertyKey: PropertyKey, attributes: PropertyDescriptor): Boolean

Adds a property to an object, or modifies attributes of an existing property.

Adds a property to an object, or modifies attributes of an existing property.

Value Params
attributes

Descriptor for the property. It can be for a data property or an accessor property.

propertyKey

The property name.

target

Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object.

@inline
def deleteProperty(target: Object, propertyKey: PropertyKey): Boolean

Removes a property from an object, equivalent to delete target[propertyKey], except it won't throw if target[propertyKey] is non-configurable.

Removes a property from an object, equivalent to delete target[propertyKey], except it won't throw if target[propertyKey] is non-configurable.

Value Params
propertyKey

The property name.

target

Object from which to remove the own property.

@inline
def get(target: Object, propertyKey: PropertyKey): Any

Gets the property of target, equivalent to target[propertyKey] when receiver === target.

Gets the property of target, equivalent to target[propertyKey] when receiver === target.

Value Params
propertyKey

The property name.

receiver

The reference to use as the this value in the getter function, if target[propertyKey] is an accessor property.

target

Object that contains the property on itself or in its prototype chain.

@inline
def get(target: Object, propertyKey: PropertyKey, receiver: Any): Any
@inline
def getOwnPropertyDescriptor(target: Object, propertyKey: PropertyKey): UndefOr[PropertyDescriptor]

Gets the own property descriptor of the specified object. An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.

Gets the own property descriptor of the specified object. An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.

Value Params
propertyKey

The property name.

target

Object that contains the property.

@inline
def getPrototypeOf(target: Object): Object | Null

Returns the prototype of an object.

Returns the prototype of an object.

Value Params
target

The object that references the prototype.

@inline
def has(target: Object, propertyKey: PropertyKey): Boolean

Equivalent to propertyKey in target.

Equivalent to propertyKey in target.

Value Params
propertyKey

Name of the property.

target

Object that contains the property on itself or in its prototype chain.

@inline
def isExtensible(target: Object): Boolean

Returns a value that indicates whether new properties can be added to an object.

Returns a value that indicates whether new properties can be added to an object.

Value Params
target

Object to test.

@inline
def ownKeys(target: Object): Array[String | Symbol]

Returns the string and symbol keys of the own properties of an object. The own properties of an object are those that are defined directly on that object, and are not inherited from the object's prototype.

Returns the string and symbol keys of the own properties of an object. The own properties of an object are those that are defined directly on that object, and are not inherited from the object's prototype.

Value Params
target

Object that contains the own properties.

@inline
def preventExtensions(target: Object): Boolean

Prevents the addition of new properties to an object.

Prevents the addition of new properties to an object.

Value Params
target

Object to make non-extensible.

Returns

Whether the object has been made non-extensible.

@inline
def set(target: Object, propertyKey: PropertyKey, value: Any): Boolean

Sets the property of target, equivalent to target[propertyKey] = value when receiver === target.

Sets the property of target, equivalent to target[propertyKey] = value when receiver === target.

Value Params
propertyKey

Name of the property.

receiver

The reference to use as the this value in the setter function, if target[propertyKey] is an accessor property.

target

Object that contains the property on itself or in its prototype chain.

@inline
def set(target: Object, propertyKey: PropertyKey, value: Any, receiver: Any): Boolean
@inline
def setPrototypeOf(target: Object): Boolean

Sets the prototype of a specified object o to object proto or null.

Sets the prototype of a specified object o to object proto or null.

Value Params
proto

The value of the new prototype or null.

target

The object to change its prototype.

Returns

Whether setting the prototype was successful.

@inline
def setPrototypeOf(target: Object, proto: Object): Boolean

Concrete fields

@JSGlobal("Reflect") @native
val ^: Any