Possible regression in Node v12.11.0's Proxy

  • Version: v12.11.0
  • process.versions:
process.versions
{
  node: '12.11.0',
  v8: '7.7.299.11-node.12',
  uv: '1.32.0',
  zlib: '1.2.11',
  brotli: '1.0.7',
  ares: '1.15.0',
  modules: '72',
  nghttp2: '1.39.2',
  napi: '5',
  llhttp: '1.1.4',
  http_parser: '2.8.0',
  openssl: '1.1.1c',
  cldr: '35.1',
  icu: '64.2',
  tz: '2019a',
  unicode: '12.1'
}
  • Platform: Darwin pmbp 18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64
  • Subsystem: V8

Running this in node v12.11.0 fails:

Object.getPrototypeOf(new Proxy(Object.create(null), {
  getPrototypeOf(target) {
    return Reflect.getPrototypeOf(target)
  }
}))

Pasting it in node's REPL gives this error:

Thrown:
TypeError: 'getPrototypeOf' on proxy: trap returned neither object nor null
    at Function.getPrototypeOf (<anonymous>)

Expected behavior: it should just print null.