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

Exceptions in getters/setters with vm.runInNewContext don't get raised #723

Closed
cloudhead opened this issue Feb 24, 2011 · 3 comments
Closed
Labels

Comments

@cloudhead
Copy link

The error here doesn't get raised, it fails silently.

var ctx = {};
Object.defineProperty(ctx, 'poo', { get: function () { throw new(Error) } }); 
vm.runInNewContext('this.poo', ctx);
@shimondoodkin
Copy link

the default of defineProperty is Enumerable=false
the correct diagnosis is that runInNewContext internals do not copy not Enumerable values
as in issue: #1402

also with getters and setters there is another issue
#540

a solution could be to put getters and setters in a sub object
or to define them from inside the script.

thanks for reporting this

i think this issue can be closed

@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

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