Skip to content

Symbol.dispose is undefined when calling vm.runInNewContext #50745

@cesaryuan

Description

@cesaryuan

Version

21.2.0

Platform

Microsoft Windows NT 10.0.19045.0 x64

Subsystem

vm

What steps will reproduce the bug?

PS E:\code> node
Welcome to Node.js v21.2.0.       
Type ".help" for more information.
> const vm = require('node:vm')
undefined
> vm.runInNewContext("Symbol.dispose")
undefined
> vm.runInNewContext("Symbol")
[Function: Symbol]

How often does it reproduce? Is there a required condition?

Can be reproduced stably

What is the expected behavior? Why is that the expected behavior?

Symbol.dispose should not be undefined. Because it is avaliable in globally, so it should also be avaliable in vm.

What do you see instead?

vm.runInNewContext("Symbol.dispose") outputs undefined.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    vmIssues and PRs related to the vm subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions