Skip to content

TypeError: Cannot convert a Symbol value to a number at util.js:398:16 #11659

@volkovasystems

Description

@volkovasystems
  • Version: v6.10.0
  • Platform: Linux richeve-biyaheroes 4.4.0-64-generic #85-Ubuntu SMP Mon Feb 20 11:50:30 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem: util
util.js:398
      return !(key >= 0 && key < raw.length);
               ^

TypeError: Cannot convert a Symbol value to a number
    at util.js:398:16
    at Array.filter (native)
    at formatValue (util.js:397:17)
    at formatProperty (util.js:794:15)
    at util.js:654:12
    at Array.map (native)
    at formatObject (util.js:653:15)
    at formatValue (util.js:592:16)
    at formatProperty (util.js:794:15)
    at util.js:654:12

I was experimenting and testing with my module on npm loosen at version 0.9.0

So my test case was this:

console.log( require( "util" ).inspect( loosen( global ), { "showHidden": true } ) );

When this code was run, the error above appears. Although it doesn't concern me really, but it bothers me because I was expecting util.inspect to handle things properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    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