Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

vm.runInNewContext incompatible with getters/setters #724

cloudhead opened this Issue Feb 24, 2011 · 4 comments


None yet
4 participants

There are some weird issues with getters/setters in context objects. Basically, node will try to set all properties in the context, including getters/setter to undefined. The issue is it treats the getters/setters like regular properties.

var ctx = { get poo() {} };
vm.runInNewContext("", ctx);

TypeError: Cannot set property poo of [object Object] which has only a getter
at Object.<anonymous> (/home/cloudhead/src/golem/test.js:29:13)
at Module._compile (module.js:374:26)
at Object..js (module.js:380:10)
at Module.load (module.js:306:31)
at Function._load (module.js:272:10)
at Array.<anonymous> (module.js:393:10)
at EventEmitter._tickCallback (node.js:108:26)

Is this a dup? joyent#540

Yea, looks like it might be!

As documented in #1801, I believe I’ve closed this with elliottcable@cf21650. I’d appreciate if you’d clone and compile against that, and see if you can still reproduce this issue. (Many of these issues seem related.)

isaacs commented Oct 19, 2011

Dupe of #540, closed by 200df86

@isaacs isaacs closed this Oct 19, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment