Skip to content

Commit

Permalink
Fixes broken autocompletion from 8bc6001
Browse files Browse the repository at this point in the history
8bc6001 removed autocompletions of
non-enumerable own-properties in trying to add enumerable prototype
properties to the autocompletions. This commit adds them back and unions
them with the enumerable prototype properties.
  • Loading branch information
michaelficarra committed May 15, 2012
1 parent dac24a3 commit 8dcbe54
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
16 changes: 8 additions & 8 deletions lib/coffee-script/repl.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion src/repl.coffee
Expand Up @@ -47,7 +47,11 @@ completeAttribute = (text) ->
val = Script.runInThisContext obj
catch error
return
completions = getCompletions prefix, (key for key of Object(val))
val = Object val
possibilities = Object.getOwnPropertyNames val
for key of val when ~possibilities.indexOf val
possibilities.push key
completions = getCompletions prefix, possibilities
[completions, prefix]

# Attempt to autocomplete an in-scope free variable: `one`.
Expand Down

0 comments on commit 8dcbe54

Please sign in to comment.