Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

vm.runInNewContext incompatible with getters/setters #724

Closed
cloudhead opened this issue Feb 24, 2011 · 4 comments
Closed

vm.runInNewContext incompatible with getters/setters #724

cloudhead opened this issue Feb 24, 2011 · 4 comments
Labels

Comments

@cloudhead
Copy link

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)
@GriffenJBS
Copy link

Is this a dup? #540

@cloudhead
Copy link
Author

Yea, looks like it might be!

@ELLIOTTCABLE
Copy link

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
Copy link

isaacs commented Oct 19, 2011

Dupe of #540, closed by 200df86

@isaacs isaacs closed this as completed Oct 19, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants