Skip to content

Large objects deadlock autocompletion #9

Description

@TimothyGu

https://github.com/devsnek/node-repl-prototype/blob/5e72bed5a127c0b3e1c7289d75c3eb157db43522/src/repl.js#L146-L149

getProperties doesn't allow any sort of timeout, so it will take forever for an object like Array(1000000).fill(0)

Activity

  1. antsmartian commented on Jul 18, 2018

    @antsmartian
    Contributor

    Ok this is interesting. I'm not sure, why we do call onAutocomplete when user types in .? Also, the same code snippet works perfectly fine in normal repl along with proper tab completion. A quick question here can't we simply use Object.getOwnPropertyNames() to get the list of method names here rather than using Runtime.getProperties are there any advantages here?

  2. devsnek commented on Aug 21, 2018

    @devsnek
    Member

    I'm going to try and add a timeout to Runtime.getProperties

  3. cactyx commented on Aug 16, 2019

    @cactyx

    I'm not too experienced with child processes in NodeJS (child_process module), but would moving autocompletion / eager evaluation to a killable fork make sense?
    The result would then be shown asynchronously.

    When the input is submitted or is changed to something syntactically different (if there's efficient ways to check this, something like removing a semicolon at the very end shouldn't re-trigger it), the fork could be killed off and the new thing would be evaluated.

    Example from the Chrome devtools (although they don't kill it if it doesn't complete quickly enough but instead it clogs the main process):
    tWgD3PXeW5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions