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

  • 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