Skip to content

console.log never finishes on Proxy with getPrototypeOf pointing to itself #26231

Closed
@kevinkassimo

Description

@kevinkassimo
  • Version:
    v11.10.0

  • Platform:
    Darwin (MacOS High Sierra)

(This is a pretty rare case: I encountered this when I was playing around with Proxy to build a dummy that always silently do nothing on any function call/value assignment given any name)

Example: console.log(p) never finishes running given the following code (potentially in an infinite loop):

const o = {};
const handler = {};
const p = new Proxy(o, handler);
handler.getPrototypeOf = () => p;
console.log(p);

In comparison, on Chrome 71 console.log would immediately finishes with output

Proxy {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    utilIssues and PRs related to the built-in util module.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions