Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
pfumagalli opened this issue Jun 16, 2015 · 3 comments
Closed

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

pfumagalli opened this issue Jun 16, 2015 · 3 comments
Labels
buffer Issues and PRs related to the buffer subsystem. confirmed-bug Issues with confirmed bugs. util Issues and PRs related to the built-in util module.

Comments

@pfumagalli
Copy link

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

@ChALkeR ChALkeR added buffer Issues and PRs related to the buffer subsystem. util Issues and PRs related to the built-in util module. labels Jun 16, 2015
@brendanashworth brendanashworth added the confirmed-bug Issues with confirmed bugs. label Jun 16, 2015
@brendanashworth brendanashworth self-assigned this Jun 16, 2015
@brendanashworth
Copy link
Contributor

Plot twist: it is imported!

@brendanashworth
Copy link
Contributor

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

@brendanashworth brendanashworth removed their assignment Jun 16, 2015
brendanashworth added a commit that referenced this issue Jun 16, 2015
PR-URL: #1988
Fixes: #1987
Reviewed-By: Roman Reiss <me@silverwind.io>
@brendanashworth
Copy link
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
Labels
buffer Issues and PRs related to the buffer subsystem. confirmed-bug Issues with confirmed bugs. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants