There's a proposal on stage 2 to add a "function hiding" directive: 
https://github.com/tc39/proposal-function-implementation-hiding. That would 
allow library authors to hide implementation details of internal functions 
and classes, and it has some benefits (described in the proposal). This 
proposal also has a side-effect of making observability tools less 
accurate, and it could hide bugs in libraries where the functions are 
hidden, making it harder to detect those bugs in production. Tools like 
Sentry <https://sentry.io/welcome/> would become less valuable in these 
scenarios.

Stripping out the directive from libraries with a tool like babel could be 
possible, but many Node.js applications don't use those tools.

If the proposal goes to Stage 3, would it be possible to have a flag (or 
maybe an API) on V8 to bypass that directive, so that Error.prototype.stack 
and Error.prototype.captureStackTrace would show the original stack trace 
instead of the redacted one? A flag would probably be more appropriate and 
performant. If the V8 team is open to have this flag but is not 
interested/doesn't have the bandwidth to implement it, I'd be happy to help.

-- 
-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-dev/74bffe27-f0e8-467e-b361-46a103650f29%40googlegroups.com.

Reply via email to