Agoric / realms-shim

Spec-compliant shim for Realms TC39 Proposal
Other
345 stars 19 forks source link

Errors in realm is hard to debug #61

Open Jack-Works opened 4 years ago

Jack-Works commented 4 years ago

callAndWrapError do evil. It ate the real useful stack generated by V8.

image

After replacing callAndWrapError with (target, ...args) => target(...args), the code stack is debuggable now.

image

As you can see, after removing callAndWrapError, I can click into the VM1421 to find out why it throws. image

Also reported in https://bugs.chromium.org/p/chromium/issues/detail?id=1008872

erights commented 4 years ago

This is fascinating. Even without callAndWrapError, similar problems may arise when throwing through a membrane. We should think about this in https://github.com/tc39/proposal-error-stacks

Attn @ajvincent @jfparadis @ljharb @caridy

jvluso commented 4 years ago

I'm not sure if this should be a separate issue, but when creating a plugin for metamask's new plugin system, evaluating an SES root realm threw the error, possible html comment syntax rejected around line 30033 I can tell that this is an error somewhere in a dependency I just added, but it would be nice to know where in the dependency it is throwing the error, if possible.