]> zoso.dev Git - buffer.git/commitdiff
populating assert on first use, to avoid circular dependency with assert.js
authorrafael <rvalle@livelens.net>
Sat, 29 Jun 2013 18:18:11 +0000 (20:18 +0200)
committerrafael <rvalle@livelens.net>
Sat, 29 Jun 2013 18:18:11 +0000 (20:18 +0200)
index.js

index 2b07520a66ebdba64736b437b897ee9cf3d647ce..6450bee4171c9d0bebc133e898f87ef8c3670277 100644 (file)
--- 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);
   }