buffer: Don't assign .parent if none exists
authorTrevor Norris <trev.norris@gmail.com>
Mon, 9 Mar 2015 18:28:31 +0000 (12:28 -0600)
committerTrevor Norris <trev.norris@gmail.com>
Mon, 9 Mar 2015 18:46:20 +0000 (12:46 -0600)
commit8070b1ff9943a53d520bf47ca1dd541f56a3c830
tree896d623f443a9ee8dffdbab5df9ce400cc8a5b7d
parente795138d5594b906d1fcf0fd50ddd559c48dc0d7
buffer: Don't assign .parent if none exists

The .parent property of the allocated buffer should remain undefined in
the case that it's not a slice. Also included test to verify this.

PR-URL: https://github.com/iojs/io.js/pull/1109
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
lib/buffer.js
test/parallel/test-buffer.js