Skip to content
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

JSError stack includes the message #136

Open
tudorms opened this issue Jun 14, 2022 · 1 comment
Open

JSError stack includes the message #136

tudorms opened this issue Jun 14, 2022 · 1 comment
Assignees

Comments

@tudorms
Copy link
Member

tudorms commented Jun 14, 2022

Per V8's documentation, the Error.stack property will include the message as well, but JSI tracks "message" and "stack" as separate properties.

We need to find a way to strip the message out of the "stack" in JSError.

@tudorms tudorms self-assigned this Jun 14, 2022
@tudorms
Copy link
Member Author

tudorms commented Jun 15, 2022

Note: my initial thought of searching for message and stripping it out of stack may not work. For example, for a stack overflow message returns Uncaught #<Object>, while stack looks like this:

RangeError: Maximum call stack size exceeded
    at eval (eval at f (eval at <anonymous> (unknown source)), <anonymous>:1:1)
    at eval (<anonymous>)
    at f (eval at <anonymous> (unknown source), <anonymous>:1:1)
    at f (eval at <anonymous> (unknown source), <anonymous>:1:1)
    at f (eval at <anonymous> (unknown source), <anonymous>:1:1)
    at f (eval at <anonymous> (unknown source), <anonymous>:1:1)
    at f (eval at <anonymous> (unknown source), <anonymous>:1:1)
    at f (eval at <anonymous> (unknown source), <anonymous>:1:1)
    at f (eval at <anonymous> (unknown source), <anonymous>:1:1)
    at f (eval at <anonymous> (unknown source), <anonymous>:1:1)

We could try reconstructing the stack out of individual call frames to have the same format, but it could get messy and not sure if all information needed is available.

tudorms added a commit to tudorms/v8-jsi that referenced this issue Jun 16, 2022
ghost pushed a commit that referenced this issue Jun 17, 2022
* Remove CETCompat

* The stack shouldn't include the message as well. Addresses #136
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant