Skip to content

vm regression: assigning a property the first time does not work; only the second time #10806

Description

@domenic
  • Version: v7.4.0
  • Platform: Windows 10 64-bit
  • Subsystem: vm

Repro:

"use strict";
const vm = require("vm");
const ctx = vm.createContext({ open() { } });
const window = vm.runInContext("this", ctx);
const other = 123;

console.log(window.open === other);
window.open = other;
console.log(window.open === other);
window.open = other;
console.log(window.open === other);

this outputs false, false, true in v7.4.0, whereas in v7.2.1 it output the expected false, true, true. I am guessing this is another regression (see also #10492) caused by 524f693. Maybe it is even the same issue, but here is a minimal repro.

/cc @fhinkel @bnoordhuis @MylesBorins

Found via jsdom/jsdom#1703

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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