28.1 The Reflect Object
The Reflect object:
- is %Reflect%.
- is the initial value of the
"Reflect" property of theglobal object . - is an
ordinary object . - has a [[Prototype]] internal slot whose value is
%Object.prototype% . - is not a
function object . - does not have a [[Construct]] internal method; it cannot be used as a
constructor with thenew
operator. - does not have a [[Call]] internal method; it cannot be invoked as a function.
28.1.1 Reflect.apply ( target, thisArgument, argumentsList )
This function performs the following steps when called:
- If
IsCallable (target) isfalse , throw aTypeError exception. - Let args be ?
CreateListFromArrayLike (argumentsList). - Perform
PrepareForTailCall (). - Return ?
Call (target, thisArgument, args).
28.1.2 Reflect.construct ( target, argumentsList [ , newTarget ] )
This function performs the following steps when called:
- If
IsConstructor (target) isfalse , throw aTypeError exception. - If newTarget is not present, set newTarget to target.
- Else if
IsConstructor (newTarget) isfalse , throw aTypeError exception. - Let args be ?
CreateListFromArrayLike (argumentsList). - Return ?
Construct (target, args, newTarget).
28.1.3 Reflect.defineProperty ( target, propertyKey, attributes )
This function performs the following steps when called:
- If target
is not an Object , throw aTypeError exception. - Let key be ?
ToPropertyKey (propertyKey). - Let desc be ?
ToPropertyDescriptor (attributes). - Return ? target.[[DefineOwnProperty]](key, desc).
28.1.4 Reflect.deleteProperty ( target, propertyKey )
This function performs the following steps when called:
- If target
is not an Object , throw aTypeError exception. - Let key be ?
ToPropertyKey (propertyKey). - Return ? target.[[Delete]](key).
28.1.5 Reflect.get ( target, propertyKey [ , receiver ] )
This function performs the following steps when called:
- If target
is not an Object , throw aTypeError exception. - Let key be ?
ToPropertyKey (propertyKey). - If receiver is not present, then
- Set receiver to target.
- Return ? target.[[Get]](key, receiver).
28.1.6 Reflect.getOwnPropertyDescriptor ( target, propertyKey )
This function performs the following steps when called:
- If target
is not an Object , throw aTypeError exception. - Let key be ?
ToPropertyKey (propertyKey). - Let desc be ? target.[[GetOwnProperty]](key).
- Return
FromPropertyDescriptor (desc).
28.1.7 Reflect.getPrototypeOf ( target )
This function performs the following steps when called:
- If target
is not an Object , throw aTypeError exception. - Return ? target.[[GetPrototypeOf]]().
28.1.8 Reflect.has ( target, propertyKey )
This function performs the following steps when called:
- If target
is not an Object , throw aTypeError exception. - Let key be ?
ToPropertyKey (propertyKey). - Return ? target.[[HasProperty]](key).
28.1.9 Reflect.isExtensible ( target )
This function performs the following steps when called:
- If target
is not an Object , throw aTypeError exception. - Return ? target.[[IsExtensible]]().
28.1.10 Reflect.ownKeys ( target )
This function performs the following steps when called:
- If target
is not an Object , throw aTypeError exception. - Let keys be ? target.[[OwnPropertyKeys]]().
- Return
CreateArrayFromList (keys).
28.1.11 Reflect.preventExtensions ( target )
This function performs the following steps when called:
- If target
is not an Object , throw aTypeError exception. - Return ? target.[[PreventExtensions]]().
28.1.12 Reflect.set ( target, propertyKey, V [ , receiver ] )
This function performs the following steps when called:
- If target
is not an Object , throw aTypeError exception. - Let key be ?
ToPropertyKey (propertyKey). - If receiver is not present, then
- Set receiver to target.
- Return ? target.[[Set]](key, V, receiver).
28.1.13 Reflect.setPrototypeOf ( target, proto )
This function performs the following steps when called:
- If target
is not an Object , throw aTypeError exception. - If proto
is not an Object and proto is notnull , throw aTypeError exception. - Return ? target.[[SetPrototypeOf]](proto).
28.1.14 Reflect [ @@toStringTag ]
The initial value of the
This property has the attributes { [[Writable]]: