Rules for using getPrototypeOf trap

These rules shouldn't be violated when using the getPrototypeOf trap:

  • It must either return an object or return a null value
  • If the target is not-extensible, then this trap must return the actual prototype

Get Learn ECMAScript - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.