-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add a do-nothing SharedError.prepareStackTrace #1290
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I'd request this change of myself if github allowed it)
One thing that's too weird about this PR as is, is that the do-nothing SharedError.prepareStackTrace
would appear on all platforms, but InitialError.prepareStackTrace
would not exist on non-v8 platforms. This needs to be more consistent, whether additively or subtractively. Waiting to understand the depd
problem better before deciding.
I've pushed some tests, but they're failing on |
It was not there because I had not understood that you needed it. It's there now. See the changes I made to your test cases. Your first two passed, but I made them more precise. Your third one is impossible with a powerless Error object. But by creating a compartment endowed with the start compartment's powerful Error object, you should be able to do anything you can do with it in the start compartment. In the endowed test case, PTAL |
The two new emulated properties:
are now added to SharedError only on v8. If we encounter code assuming these on other platforms, we can revisit. The |
In practice the assumption If we run codebase with depd in Endo we'll get into trouble again. For depd in particular a simple patch-package change to the package.json to define an export for Endo would do. Not sure about other packages. Anyway, this is now a great improvement to ecosystem compatibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The approach seems sane
This PR does what I thought I understood to solve your
depd
problem. Does it?If so, perhaps you should rebase #1286 on this and adapt your test so it passes. At the moment, this PR does not include any test for the added property, so your test would be most welcome
If not, please help me correct my misunderstanding.