Skip to content
This repository was archived by the owner on Apr 15, 2026. It is now read-only.

Commit 190b567

Browse files
authored
Fix missing inherited getters in enumeratePropertyCompletions
FIX: When reading properties in `scopeCompletionSource`, use the original object, not a prototype.
1 parent a94cdcb commit 190b567

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/complete.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,14 @@ export function completionPath(context: CompletionContext): {path: readonly stri
134134
}
135135

136136
function enumeratePropertyCompletions(obj: any, top: boolean): readonly Completion[] {
137+
let originalObj = obj
137138
let options: Completion[] = [], seen: Set<string> = new Set
138139
for (let depth = 0;; depth++) {
139140
for (let name of (Object.getOwnPropertyNames || Object.keys)(obj)) {
140141
if (!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(name) || seen.has(name)) continue
141142
seen.add(name)
142143
let value
143-
try { value = obj[name] }
144+
try { value = originalObj[name] }
144145
catch(_) { continue }
145146
options.push({
146147
label: name,

0 commit comments

Comments
 (0)