buffer: don't abort on prototype getters
authorTrevor Norris <trev.norris@gmail.com>
Fri, 9 Oct 2015 20:18:54 +0000 (14:18 -0600)
committerJames M Snell <jasnell@gmail.com>
Sat, 10 Oct 2015 17:55:26 +0000 (10:55 -0700)
commit54795620f652271840b400b6f6d7581d128d5628
tree1135af49faaeed8212e94c59b291c52a69e62a86
parent071c72a6a38340ddd2aa1281ec539ff51793e383
buffer: don't abort on prototype getters

Accessing prototype properties directly on a typed array will throw. So
do an extra check in Buffer's own getters to verify it is being called
on an instance.

Fixes: https://github.com/nodejs/node/issues/3297
PR-URL: https://github.com/nodejs/node/pull/3302
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
lib/buffer.js
test/parallel/test-buffer.js