Sitelet https://github.com/nodejs/node/issues/1987
Skip to content

util.isBuffer(...) fails on 2.3.0 #1987

Description

@pfumagalli

Someone forgot to import Buffer in util.js:

$ node -v
v2.3.0
$ node
> util.isBuffer('foo');
TypeError: Expecting a function in instanceof check, but got undefined
    at Object.isBuffer (util.js:666:25)
    at repl:1:6
    at REPLServer.defaultEval (repl.js:154:27)
    at bound (domain.js:254:14)
    at REPLServer.runBound [as eval] (domain.js:267:12)
    at REPLServer.<anonymous> (repl.js:308:12)
    at emitOne (events.js:77:13)
    at REPLServer.emit (events.js:169:7)
    at REPLServer.Interface._onLine (readline.js:209:10)
    at REPLServer.Interface._line (readline.js:548:8)

Works fine after downgrading to 2.2.1:

$ node -v
v2.2.1
$ node
> util.isBuffer('foo');
false

Seems related to b5b8ff1

Activity

  1. added
    bufferIssues and PRs related to the buffer subsystem.
    utilIssues and PRs related to the built-in util module.
    on Jun 16, 2015
  2. brendanashworth commented on Jun 16, 2015

    @brendanashworth
    Contributor

    Plot twist: it is imported!

  3. brendanashworth commented on Jun 16, 2015

    @brendanashworth
    Contributor

    The new import seems to be causing an issue with circular dependencies. Patch pending.

  4. removed their assignment
    on Jun 16, 2015
  5. brendanashworth commented on Jun 16, 2015

    @brendanashworth
    Contributor

    Thanks for reporting the bug! It should be fixed as of d5637e6, and a release with the patch is coming out soon.

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

    bufferIssues and PRs related to the buffer subsystem.confirmed-bugIssues and PRs for confirmed bugs.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