Weird Proxy internal util.inspect error

  • Version: v10.14.2 & v11.5.0
  • Platform: Linux
  • Subsystem: inspect?

The following code:

let thing;
thing = new Proxy(() => {}, {
  get() {
    return thing;
  },
  apply() {
    return thing;
  }
});
console.info(thing);

emits the following error when executed:

internal/util/inspect.js:594
      const name = `${type}${value.name ? `: ${value.name}` : ''}`;
                                                     ^

TypeError: Cannot convert object to primitive value
    at formatRaw (internal/util/inspect.js:594:54)
    at formatValue (internal/util/inspect.js:508:10)
    at inspect (internal/util/inspect.js:191:10)
    at Object.formatWithOptions (util.js:84:12)
    at Console.(anonymous function) (console.js:188:15)
    at Console.log (console.js:199:31)
    at Object.<anonymous> (/home/ubuntu/workspace/thread/index.js:12:9)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)

If I remove either the get() or the apply() it works, but when both are set it errors.