- propertyOverride,
- );
- return defineOwnProperty(constructor, "prototype", {
- writable: false,
- });
- },
- };
-})();
-
-export const {
- /**
- * Calls the provided function with the provided this value and
- * arguments list.
- *
- * ☡ This is effectively an alias for `Reflect.apply`—the arguments
- * must be passed as an arraylike.
- */
- call,
-
- /**
- * Constructs the provided function with the provided arguments list
- * and new target.
- *
- * ☡ This is effectively an alias for `Reflect.construct`—the
- * arguments must be passed as an arraylike.
- */
- construct,
-
- /** Returns whether the provided value is a constructor. */
- isConstructor,
-} = (() => {
- const { apply, construct } = Reflect;
- return {
- call: (target, thisArgument, argumentsList) =>
- apply(target, thisArgument, argumentsList),
- construct: (target, argumentsList, ...args) =>
- args.length > 0
- ? construct(target, argumentsList, args[0])
- : construct(target, argumentsList),
- isConstructor: ($) =>
- completesNormally(() =>
- // Try constructing a new object with the provided value as its
- // `new.target`. This will throw if the provided value is not a
- // constructor.
- construct(function () {}, [], $)