Skip to content

util: .inspect() misformats __proto__ property on prototype-less object #3788

Description

@bnoordhuis
> var o = Object.create(null); o.__proton__ = 42; util.inspect(o)
'{ __proton__: 42 }'  // no brackets

> var o = Object.create(null); o.__proto__ = 42; util.inspect(o)
'{ [__proto__]: 42 }'  // brackets

I speculate arrayToHash() needs to use Object.create(null) for its dictionary object.

Activity

  1. added
    utilIssues and PRs related to the built-in util module.
    on Nov 12, 2015
  2. added
    good first issueIssues that are suitable for first-time contributors.
    on Nov 12, 2015
  3. JungMinu commented on Nov 12, 2015

    @JungMinu
    Member

    @bnoordhuis I will handle this 😄

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

    good first issueIssues that are suitable for first-time contributors.utilIssues and PRs related to the built-in util module.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions