diff options
author | isaacs <i@izs.me> | 2013-10-25 18:56:25 -0700 |
---|---|---|
committer | isaacs <i@izs.me> | 2013-10-28 08:43:43 -0700 |
commit | 3c5ea410ca56da3d4785e2563cb2724364669fd2 (patch) | |
tree | d2aa62bffa12d55e4fa16ff7fc63226db7995bbb /doc/api/fs.markdown | |
parent | 4c0195e0340220e53fe5c44299eff53f2f0e210c (diff) | |
download | node-new-3c5ea410ca56da3d4785e2563cb2724364669fd2.tar.gz |
vm: Copy missing properties from context
This addresses a current shortcoming of the V8 SetNamedPropertyHandler
function.
It does not provide a way to intercept Object.defineProperty(..) calls.
As a result, these properties are not copied onto the contextified
sandbox when a new global property is added via either a function
declaration or a Object.defineProperty(global, ...) call.
Note that any function declarations or Object.defineProperty() globals
that are created asynchronously (in a setTimeout, callback, etc.) will
happen AFTER the call to copy properties, and thus not be caught.
The way to properly fix this is to add some sort of a
Object::SetNamedDefinePropertyHandler() function that takes a callback,
which receives the property name and property descriptor as arguments.
Luckily, such situations are rare, and asynchronously-added globals
weren't supported by Node's VM module until 0.12 anyway. But, this
should be fixed properly in V8, and this copy function should be removed
once there is a better way.
Fix #6416
Diffstat (limited to 'doc/api/fs.markdown')
0 files changed, 0 insertions, 0 deletions