From 3a0c010800e1efc87722d0c6c97705dc7d808b86 Mon Sep 17 00:00:00 2001 From: James Halliday Date: Wed, 20 Mar 2013 10:56:17 -0700 Subject: [PATCH] indexes test passes --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index 1d81be0..d6511fd 100644 --- a/index.js +++ b/index.js @@ -379,14 +379,19 @@ function Buffer(subject, encoding, offset) { for (var i = 0; i < this.length; i++) { if (subject instanceof Buffer) { this.parent[i + this.offset] = subject.readUInt8(i); + this[i] = subject.readUInt8(i); } else { this.parent[i + this.offset] = subject[i]; + this[i] = subject[i]; } } } else if (type == 'string') { // We are a string this.length = this.write(subject, 0, encoding); + for (var i = 0; i < this.length; i++) { + this[i] = this.parent[i]; + } } } -- 2.34.1