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

Method apply

lib/internal/test_runner/mock/mock.js:757–781  ·  view source on GitHub ↗
(_fn, thisArg, argList)

Source from the content-addressed store, hash-verified

755 const mock = new Proxy(fnToMatch, {
756 __proto__: null,
757 apply(_fn, thisArg, argList) {
758 const fn = FunctionPrototypeCall(nextImpl, ctx);
759 let result;
760 let error;
761
762 try {
763 result = ReflectApply(fn, thisArg, argList);
764 } catch (err) {
765 error = err;
766 throw err;
767 } finally {
768 FunctionPrototypeCall(trackCall, ctx, {
769 __proto__: null,
770 arguments: argList,
771 error,
772 result,
773 // eslint-disable-next-line no-restricted-syntax
774 stack: new Error(),
775 target: undefined,
776 this: thisArg,
777 });
778 }
779
780 return result;
781 },
782 construct(target, argList, newTarget) {
783 const realTarget = FunctionPrototypeCall(nextImpl, ctx);
784 let result;

Callers 15

mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
usingRestAndApplyFunction · 0.45
usingArgumentsAndApplyFunction · 0.45
wrappedEmitFunction · 0.45
monkeyPatchGetWindowSizeFunction · 0.45
FakeStreamFunction · 0.45
mustSucceedFunction · 0.45
_returnFunction · 0.45
fixturesPathFunction · 0.45
fixturesFileURLFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected