Replies: 1 comment
-
Its not a general issue, I found a way to test it without vm: Object.defineProperty(
globalThis,
'foo',
{
get: ( ) => { console.log( 'get' ); return 'bar'; },
set: ( v ) => { console.log( 'set', v ); }
}
);
foo = 'sup'; works as expected. IMO it has something to do with contextifying a Proxy. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Following minimal example code:
produces (node 21.1.0)
simple is as expected, but why in case of a VM script are globals set twice?
Posting it as discussion since technically its not an issue*, just wondering, is this a result because I contextified a Proxy, or does node/V8 always set globals twice? (it wouldn't be noticed otherwise, or I can think of a way to make this without the vm module).
Beta Was this translation helpful? Give feedback.
All reactions