Skip to content

Redefinition of function in context #9105

Description

@arlolra

Is this expected?

var vm = require("vm");
var ctx = vm.createContext();
ctx.console = console;
vm.runInContext("function red() { console.log('red'); }", ctx);
ctx.red();  // > red
vm.runInContext("function red() { console.log('green'); }", ctx);
ctx.red();  // > red

Pre- node v0.11.7, this used to log > green.

Activity

  1. added
    vmIssues and PRs related to the vm subsystem.
    on Oct 14, 2016
  2. Fishrock123 commented on Oct 14, 2016

    @Fishrock123
    Contributor

    duplicate of #548 -- this a long known but difficult to fix issue

  3. added
    duplicateIssues and PRs that are duplicates of other issues or PRs.
    on Oct 14, 2016
  4. arlolra commented on Oct 14, 2016

    @arlolra
    ContributorAuthor

    @Fishrock123 ok, thanks

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

    duplicateIssues and PRs that are duplicates of other issues or PRs.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