tc39 / proposal-error-stacks

ECMAScript Proposal, specs, and reference implementation for Error.prototype.stack / System.getStack
https://tc39.github.io/proposal-error-stacks/
MIT License
168 stars 13 forks source link

Why have the System object? #28

Closed mathiasbynens closed 3 days ago

mathiasbynens commented 5 years ago

This repository doesn’t seem to mention any rationale for it. It would be good to document it.

erights commented 5 years ago

For reasons explained at https://github.com/tc39/proposal-weakrefs/issues/22#issuecomment-491097466 we no longer need a System object, or a standardized whitelist of globals.

ljharb commented 5 years ago

In that case, would getStack and getStackString be able to live on the Error constructor, or for compartment reasons, would they still need a separate global?

erights commented 5 years ago

Still need separate globals. As you pointed out, with System, we'd only need one global, rather than two for error stacks and another two for weakrefs. I would still prefer that. But I am no longer arguing that System is necessary. We can live with four new globals instead.