Skip to content

VM module doesn't handle undefined/NaN/null correctly #14660

Closed
@TimothyGu

Description

@TimothyGu
  • Version: v8.2.1
  • Platform: Linux 4.9.0-3-amd64 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) x86_64 GNU/Linux
  • Subsystem: vm
> vm.runInNewContext('undefined', { undefined: 123 })
123
> vm.runInNewContext('this.undefined', { undefined: 123 })
123
> // Compare:
> this.undefined = 123
> undefined
undefined
> this.undefined
undefined

undefined (and NaN and Infinity) is defined as unwritable, unconfigurable, unenumerable properties on the global object, and thus IMO should not be overridable through the VM module.

It is unclear if #13265 fixes this, probably not though as this issue concerns getting the value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    v8 engineIssues and PRs related to the V8 dependency.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