Stack frames across realm boundaries: configuration argument?

2 views
Skip to first unread message

Alex Vincent

unread,
Nov 2, 2022, 2:29:05 PM11/2/22
to SES Strategy
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

Mathieu Hofman

unread,
Nov 2, 2022, 3:36:56 PM11/2/22
to Alex Vincent, SES Strategy
Error stacks are not part of ECMA262 (yet), so providing options to control them would not be in scope for the ShadowRealm API.

--
You received this message because you are subscribed to the Google Groups "SES-strategy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ses-strategy...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ses-strategy/CAEZ8442iJV0nWFrassoTzSj1F5_d9FV0-k66fU0MeFc7mey9qg%40mail.gmail.com.

Mark S. Miller

unread,
Nov 2, 2022, 3:41:33 PM11/2/22
to Mathieu Hofman, Alex Vincent, SES Strategy
The non-postponable tactical issue is that implementors will implement something, that then becomes legacy we cannot break. So the hard issue is not what is in scope of the language standard, but what is in scope for a recommendation we can get everyone to agree to now, even if it doesn't come to be in de jure scope until later.


Reply all
Reply to author
Forward
0 new messages