Skip to content

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Aug 27, 2025

Replaced with assert, abort or throw new Error accordingly. We almost never want to be throwing plain values because we don't end up with a stack trace in that case.

@sbc100 sbc100 force-pushed the no_throw_strings branch 3 times, most recently from 069dc52 to 8a1d22f Compare August 28, 2025 00:23
@brendandahl
Copy link
Collaborator

What's the criteria for choosing throw new Error vs abort?

@sbc100
Copy link
Collaborator Author

sbc100 commented Aug 28, 2025

What's the criteria for choosing throw new Error vs abort?

I tried to use abort whenever I know that the code is running in the context of emscripten-generated code, and after the definition of abort itself (which I think happens in shell.js).

@sbc100
Copy link
Collaborator Author

sbc100 commented Aug 28, 2025

What's the criteria for choosing throw new Error vs abort?

I tried to use abort whenever I know that the code is running in the context of emscripten-generated code, and after the definition of abort itself (which I think happens in shell.js).

But I now that I wasn't very consistent :)

@sbc100
Copy link
Collaborator Author

sbc100 commented Aug 28, 2025

Ok, should be more consistent now. I've used abort whereever I'm sure its ok to us it.

@sbc100 sbc100 force-pushed the no_throw_strings branch 3 times, most recently from 2a3fd8b to 1599a3a Compare August 28, 2025 19:08
Replaced with `assert`, `abort` or `throw new Error` accordingly.  We
almost never want to be throwing plain values because we don't end up
with a stack trace in that case.
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

Successfully merging this pull request may close these issues.

3 participants