Spot the bug in SecretBox proxying

from Private fields
Node 24 intermediate 4 min 1 issue to find

Find why the proxy cannot call reveal even though the target can.

JavaScript
class SecretBox {
  #secret;

  constructor(secret) {
    this.#secret = secret;
  }

  reveal() {
    return this.#secret;
  }
}

const target = new SecretBox('ready');
const proxy = new Proxy(target, {});
console.log(proxy.reveal());
Open in playground
Report an error