Skip to content

repl completion for large buffers fails to display named properties #21446

Closed

Description

@killagu
  • Version: v10.5.0
  • Platform: macOS
  • Subsystem:REPL

When alloc a large buffer, and input a. then press tab. It's a warning.

> a = Buffer.alloc(1024*1024)
<Buffer 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... >
> a.
(node:7432) REPLWarning: The current array, Buffer or TypedArray has too many entries. Certain properties may be missing from completion output.

But it works well, when alloc a small buffer.

> a = Buffer.alloc(1024)
<Buffer 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... >
> a.
a.__defineGetter__      a.__defineSetter__      a.__lookupGetter__      a.__lookupSetter__      a.__proto__             a.constructor           a.hasOwnProperty        a.isPrototypeOf         a.propertyIsEnumerable
a.toLocaleString        a.toString              a.valueOf               

a.buffer                a.byteLength            a.byteOffset            a.copyWithin            a.entries               a.every                 a.fill                  a.filter                a.find
a.findIndex             a.forEach               a.includes              a.indexOf               a.join                  a.keys                  a.lastIndexOf           a.length                a.map
a.reduce                a.reduceRight           a.reverse               a.set                   a.slice                 a.some                  a.sort                  a.subarray              a.values

a.BYTES_PER_ELEMENT     

a.asciiSlice            a.asciiWrite            a.base64Slice           a.base64Write           a.compare               a.copy                  a.equals                a.hexSlice              a.hexWrite
a.inspect               a.latin1Slice           a.latin1Write           a.offset                a.parent                a.readDoubleBE          a.readDoubleLE          a.readFloatBE           a.readFloatLE
a.readInt16BE           a.readInt16LE           a.readInt32BE           a.readInt32LE           a.readInt8              a.readIntBE             a.readIntLE             a.readUInt16BE          a.readUInt16LE
a.readUInt32BE          a.readUInt32LE          a.readUInt8             a.readUIntBE            a.readUIntLE            a.swap16                a.swap32                a.swap64                a.toJSON
a.ucs2Slice             a.ucs2Write             a.utf8Slice             a.utf8Write             a.write                 a.writeDoubleBE         a.writeDoubleLE         a.writeFloatBE          a.writeFloatLE
a.writeInt16BE          a.writeInt16LE          a.writeInt32BE          a.writeInt32LE          a.writeInt8             a.writeIntBE            a.writeIntLE            a.writeUInt16BE         a.writeUInt16LE
a.writeUInt32BE         a.writeUInt32LE         a.writeUInt8            a.writeUIntBE           a.writeUIntLE           

Activity

  1. added
    confirmed-bugIssues and PRs for confirmed bugs.
    replIssues and PRs related to the REPL subsystem.
    on Jun 21, 2018
  2. Fishrock123 commented on Jun 21, 2018

    @Fishrock123
    Contributor

    I think it might be fixable. We should lookup named properties first, which should be possible.

  3. changed the title [-]repl bug[/-] [+]repl completion for large buffers fails to display named properties[/+] on Jun 21, 2018
  4. thatshailesh commented on Jun 22, 2018

    @thatshailesh
    Contributor

    Interesred in picking this up.. need some guidance

  5. deleted a comment from on Jun 22, 2018
  6. bnoordhuis commented on Jun 22, 2018

    @bnoordhuis
    Member

    We should lookup named properties first, which should be possible.

    Not without changes to V8 first. There is currently no way to retrieve a bounded number of own properties.

    We might be able to make do with a for/in loop and check each key with Object#hasOwnProperty().

  7. added a commit that references this issue on Aug 24, 2018
  8. added a commit that references this issue on Sep 3, 2018
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

    confirmed-bugIssues and PRs for confirmed bugs.replIssues and PRs related to the REPL subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions