Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: node:vm not setting object property #23186

Closed
marvinhagemeister opened this issue Apr 2, 2024 · 2 comments · Fixed by #23202
Closed

Bug: node:vm not setting object property #23186

marvinhagemeister opened this issue Apr 2, 2024 · 2 comments · Fixed by #23202
Labels
bug Something isn't working correctly node compat

Comments

@marvinhagemeister
Copy link
Contributor

Came across this in the Redux test suite: https://github.com/reduxjs/redux/blob/5455b8d54cd188b2d4b15f7dba055a66125f09b3/test/utils/isPlainObject.spec.ts#L6-L9

Steps to reproduce

import vm from "node:vm";
const sandbox = { fromAnotherRealm: false };
vm.runInNewContext("fromAnotherRealm = {}", sandbox);

// Should log `{}`, but logs `false`
console.log(sandbox.fromAnotherRealm);

Version: Deno 1.42.1

@marvinhagemeister marvinhagemeister added bug Something isn't working correctly node compat labels Apr 2, 2024
@bartlomieju
Copy link
Member

@littledivy got it working earlier today in denoland/deno_core#664. We will be upstreaming it to Deno in the next few days.

littledivy added a commit that referenced this issue Apr 9, 2024
Implement contextified objects in `node:vm`

Fixes #23186
Fixes #22395
Fixes #20607
Fixes #18299
Fixes #19395
Fixes #18315
Fixes #18319
Fixes #23183
@birkskyum
Copy link
Contributor

birkskyum commented Apr 9, 2024

Can confirm this now logs {} as expected 🎉

satyarohith pushed a commit that referenced this issue Apr 11, 2024
Implement contextified objects in `node:vm`

Fixes #23186
Fixes #22395
Fixes #20607
Fixes #18299
Fixes #19395
Fixes #18315
Fixes #18319
Fixes #23183
littledivy added a commit to littledivy/deno that referenced this issue Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants