MCPcopy Create free account
hub / github.com/nodejs/node / findMethodOnPrototypeChain

Function findMethodOnPrototypeChain

lib/internal/test_runner/mock/mock.js:999–1014  ·  view source on GitHub ↗
(instance, methodName)

Source from the content-addressed store, hash-verified

997}
998
999function findMethodOnPrototypeChain(instance, methodName) {
1000 let host = instance;
1001 let descriptor;
1002
1003 while (host !== null) {
1004 descriptor = ObjectGetOwnPropertyDescriptor(host, methodName);
1005
1006 if (descriptor) {
1007 break;
1008 }
1009
1010 host = ObjectGetPrototypeOf(host);
1011 }
1012
1013 return descriptor;
1014}
1015
1016function ensureNodeScheme(specifier) {
1017 if (!StringPrototypeStartsWith(specifier, 'node:')) {

Callers 1

methodMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected