Skip to content

Conversation

@hoodmane
Copy link
Collaborator

@hoodmane hoodmane commented Nov 27, 2024

Sometimes we throw MEMFS.doesNotExistError before it is initialized. It doesn't really matter because the undefined we throw gets caught and thrown away, but it seems better to fix.

Sometimes we throw `MEMFS.doesNotExistError` before it is initialized. It
doesn't really matter because the error gets caught and thrown away, but it
seems better to fix.
addToLibrary({
$MEMFS__deps: ['$FS', '$mmapAlloc'],
#if !ASSERTIONS
$MEMFS__postset: `
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain how MEMFS.doesNotExistError could get used before the postset run? IIUC the post set code is emitted at the top level at the end of the library top level code. Is the problem that other postset code wants to run first?

Wouldn't preset attempt to set MEMFS.doesNotExistError before MEMFS itself is created?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually __preset just doesn't exist. Only __postset. So I'm not sure how this could work.

@hoodmane hoodmane closed this Nov 28, 2024
@hoodmane hoodmane deleted the pre-set-dne-error branch December 9, 2024 15:50
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.

2 participants