Skip to content

Commit

Permalink
fix: don't eval function calls for suggestions (#1382)
Browse files Browse the repository at this point in the history
  • Loading branch information
André Medeiros authored Mar 5, 2019
1 parent 78201ce commit 73a0672
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/embark/src/lib/modules/console/suggestions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ export default class Suggestions {
}

public getSuggestions(cmd: string, cb: (results: SuggestionsList) => any) {
// Don't bother returning suggestions for empty commands or for
// commands that already have `(` or `)` to avoid executing code
if (cmd === "") { return cb([]); }
if (cmd.indexOf("(") !== -1 || cmd.indexOf(")") !== -1) { return cb([]); }

const suggestions = this.suggestions;

Expand Down

0 comments on commit 73a0672

Please sign in to comment.