Skip to content

new Buffer() constructor is deprecated #46

Description

@RomainOliva

if (typeof buffer === "string") buffer = new Buffer(buffer);

this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate, intVal)));

this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate)));

this.appendStringBuf(new Buffer(String.fromCharCode(intVal)));

Use Buffer constructor is currently depreciated :

It's not possible to deprecate Node.js ≤ 4.4.x and 5.0.0 — 5.9.x or maybe use a polyfill ?

Or maybe you can just use the alloc method to keep compatibility :

jsonparse/jsonparse.js

Lines 54 to 56 in b2d8bc6

function alloc(size) {
return Buffer.alloc ? Buffer.alloc(size) : new Buffer(size);
}

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions