From: rafael Date: Sat, 29 Jun 2013 18:18:11 +0000 (+0200) Subject: populating assert on first use, to avoid circular dependency with assert.js X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=c42154761e7cf9fb08a43708aa29dde933d8b356;p=buffer.git populating assert on first use, to avoid circular dependency with assert.js --- diff --git a/index.js b/index.js index 2b07520..6450bee 100644 --- a/index.js +++ b/index.js @@ -1,10 +1,11 @@ -var assert = require('assert'); +var assert; exports.Buffer = Buffer; exports.SlowBuffer = Buffer; Buffer.poolSize = 8192; exports.INSPECT_MAX_BYTES = 50; function Buffer(subject, encoding, offset) { + if(!assert) assert== require('assert'); if (!(this instanceof Buffer)) { return new Buffer(subject, encoding, offset); }