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

Function filteredOwnPropertyNames

lib/internal/repl/completion.js:127–144  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

125}
126
127function filteredOwnPropertyNames(obj) {
128 if (!obj) return [];
129 // `Object.prototype` is the only non-contrived object that fulfills
130 // `Object.getPrototypeOf(X) === null &&
131 // Object.getPrototypeOf(Object.getPrototypeOf(X.constructor)) === X`.
132 let isObjectPrototype = false;
133 if (ObjectGetPrototypeOf(obj) === null) {
134 const ctorDescriptor = ObjectGetOwnPropertyDescriptor(obj, 'constructor');
135 if (ctorDescriptor?.value) {
136 const ctorProto = ObjectGetPrototypeOf(ctorDescriptor.value);
137 isObjectPrototype = ctorProto && ObjectGetPrototypeOf(ctorProto) === obj;
138 }
139 }
140 const filter = ALL_PROPERTIES | SKIP_SYMBOLS;
141 return ArrayPrototypeFilter(
142 getOwnNonIndexProperties(obj, filter),
143 isObjectPrototype ? isNotLegacyObjectPrototypeMethod : isIdentifier);
144}
145
146function addCommonWords(completionGroups) {
147 // Only words which do not yet exist as global property should be added to

Callers 1

completeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…