MCPcopy Index your code
hub / github.com/nodejs/node / construct

Method construct

lib/internal/test_runner/mock/mock.js:782–806  ·  view source on GitHub ↗
(target, argList, newTarget)

Source from the content-addressed store, hash-verified

780 return result;
781 },
782 construct(target, argList, newTarget) {
783 const realTarget = FunctionPrototypeCall(nextImpl, ctx);
784 let result;
785 let error;
786
787 try {
788 result = ReflectConstruct(realTarget, argList, newTarget);
789 } catch (err) {
790 error = err;
791 throw err;
792 } finally {
793 FunctionPrototypeCall(trackCall, ctx, {
794 __proto__: null,
795 arguments: argList,
796 error,
797 result,
798 // eslint-disable-next-line no-restricted-syntax
799 stack: new Error(),
800 target,
801 this: result,
802 });
803 }
804
805 return result;
806 },
807 get(target, property, receiver) {
808 if (property === 'mock') {
809 return ctx;

Callers 7

WritableFunction · 0.45
DuplexFunction · 0.45
ReadableFunction · 0.45
test.jsFile · 0.45
test.jsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected