Skip to content
This repository was archived by the owner on Feb 1, 2022. It is now read-only.

Commit 2cfe74b

Browse files
authored
Merge pull request #28 from aqrln/fix-repl-crash
Make autocompletion in REPL work
2 parents 37cc9b7 + ccab737 commit 2cfe74b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/internal/inspect_repl.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ class ScopeSnapshot {
238238
const value = new RemoteObject(prop.value);
239239
return [prop.name, value];
240240
}));
241+
this.completionGroup = properties.map((prop) => prop.name);
241242
}
242243

243244
[util.inspect.custom](depth, opts) {
@@ -480,7 +481,9 @@ function createRepl(inspector) {
480481
if (!selectedFrame) {
481482
return Promise.reject(new Error('Requires execution to be paused'));
482483
}
483-
return selectedFrame.loadScopes();
484+
return selectedFrame.loadScopes().then((scopes) => {
485+
return scopes.map((scope) => scope.completionGroup);
486+
});
484487
}
485488

486489
if (selectedFrame) {

0 commit comments

Comments
 (0)