src: make accessors immune to context confusion
authorBen Noordhuis <info@bnoordhuis.nl>
Sun, 22 Mar 2015 23:26:59 +0000 (00:26 +0100)
committerBen Noordhuis <info@bnoordhuis.nl>
Mon, 23 Mar 2015 09:40:12 +0000 (10:40 +0100)
commit7e88a9322c8f1b5393723d6f99590d750b097569
treeef3f4d358d11d2db3b8c4a0ca75ad27e97e61ebe
parent20c4498e76af9bd639a752aae3e36571251c3c2d
src: make accessors immune to context confusion

It's possible for an accessor or named interceptor to get called with
a different execution context than the one it lives in, see the test
case for an example using the debug API.

This commit fortifies against that by passing the environment as a
data property instead of looking it up through the current context.

Fixes: https://github.com/iojs/io.js/issues/1190 (again)
PR-URL: https://github.com/iojs/io.js/pull/1238
Reviewed-By: Fedor Indutny <fedor@indutny.com>
src/env-inl.h
src/env.h
src/node.cc
src/node_crypto.cc
src/node_internals.h
src/stream_base-inl.h
src/udp_wrap.cc
test/parallel/test-vm-debug-context.js