Per today's SES meeting, this is a really complicated subject. I think we should consider letting the realm's creator specify stack frame censorship rules for the realm at construction time.
I know, it's really late in the game to suggest changing the API, but this debate on error stack handling continues...
Default behavior is no censorship, I presume, but we may want an argument in the constructor with several options as symbols:
- ShadowRealm.ERROR_SHOW_FRAMES for no censorship
- ShadowRealm.ERROR_EMPTY_STACK for the stack trace being utterly empty
- ShadowRealm.ERROR_HIDE_FRAMES for hiding stack frames from this realm
- ShadowRealm.ERROR_HIDE_EXTERNAL for hiding stack frames from other realms
- If there's a specific configuration (include some realm's frames, exclude other realm's frames), we can provide an API for this later to create a specific symbol key.
I would suggest `constructor({errorStackRule: symbol})`.
--
"The first step in confirming there is a bug in someone else's work is confirming there are no bugs in your own."
-- Alexander J. Vincent, June 30, 2001