In particular: the error details, then on a new line each, stack frame strings prefixed by a space, with no trailing new line (or space) at the end of the overall string.
#### JavaScriptCore
%%%makeError@/tmp/iG9Fhho45sqTzR2t5UO5/f-1696624184583-9045-1v3jfly.08s3.js:2:2222
global code@/tmp/iG9Fhho45sqTzR2t5UO5/f-1696624184583-9045-1v3jfly.08s3.js:3:22%%%
#### Moddable XS
%%%CustomError: my message
at makeError (/tmp/3h6En0rXJ9qeV80kfdUL/f-1696624184529-9045-gb7iqc.x9dy9.js:16)
at (/tmp/3h6En0rXJ9qeV80kfdUL/f-1696624184529-9045-gb7iqc.x9dy9.js:17)%%%
#### SpiderMonkey
%%%makeError@/tmp/9Zl3zp4fFEW8J8HMSw4l/f-1696624184592-9045-183o0we.gm59j.js:2:8095
@/tmp/9Zl3zp4fFEW8J8HMSw4l/f-1696624184592-9045-183o0we.gm59j.js:3:22
%%%
#### V8
%%%CustomError: my message
at makeError (/tmp/FiORUnWr2NZJAm7DpKRK/f-1696624184560-9045-1b24p8y.tdtt.js:2:5916)
at /tmp/FiORUnWr2NZJAm7DpKRK/f-1696624184560-9045-1b24p8y.tdtt.js:3:13%%%
Observed behavior
JavaScriptCore and SpiderMonkey seem to omit the error details, and stack frames are not prefixed by spaces. SpiderMonkey always seem to have a trailing new line.
XS and v8 stack traces have similar formats. They both include the error details, but have varied amount of head white space for the stack frame lines, followed by the string at before the stack frame string.
Open question
Should we model the frame string against Moddable / XS, and include the string at to avoid rewriting stacks on our main platforms.
Describe the bug
Depending on
errorTaming
and the JS platform, the stack string values are not quite consistent.Expected behavior
Error.getStackString()
should return a string matching the proposal. In pseudo codeIn particular: the error details, then on a new line each, stack frame strings prefixed by a space, with no trailing new line (or space) at the end of the overall string.
Steps to reproduce
Run the following with
eshost
:Observed behavior
JavaScriptCore and SpiderMonkey seem to omit the error details, and stack frames are not prefixed by spaces. SpiderMonkey always seem to have a trailing new line.
XS and v8 stack traces have similar formats. They both include the error details, but have varied amount of head white space for the stack frame lines, followed by the string
at
before the stack frame string.Open question
Should we model the frame string against Moddable / XS, and include the string
at
to avoid rewriting stacks on our main platforms.