Skip to content

Fix for early use of threadPrintErr - #16166

Merged
sbc100 merged 1 commit into
mainfrom
fix_threadPrintErr
Feb 1, 2022
Merged

sbc100 merged 1 commit into
mainfrom
fix_threadPrintErr

Conversation

@sbc100

@sbc100 sbc100 commented Feb 1, 2022

Copy link
Copy Markdown
Collaborator

Followup to #16161 such that printing works before the module is loaded.
This function depends on ENVIRONMENT_IS_NODE and fs which were
previously not defined until the main module was loaded.

@sbc100
sbc100 force-pushed the fix_threadPrintErr branch from 707d61e to 69fcd16 Compare February 1, 2022 14:33
@sbc100
sbc100 requested a review from kripken February 1, 2022 14:33
@sbc100
sbc100 enabled auto-merge (squash) February 1, 2022 14:33
Followup to #16161 such that printing works before the module is loaded.
This function depends on `ENVIRONMENT_IS_NODE` and `fs` which were
previously not defined until the main module was loaded.
@sbc100
sbc100 force-pushed the fix_threadPrintErr branch from 69fcd16 to 870c2ac Compare February 1, 2022 17:51
@kripken

kripken commented Feb 1, 2022

Copy link
Copy Markdown
Member

This function depends on ENVIRONMENT_IS_NODE and fs which were previously not defined until the main module was loaded.

In what manner? worker.js before this PR does not mention that variable. It is a dependency in shell.js somehow..?

@sbc100

sbc100 commented Feb 1, 2022

Copy link
Copy Markdown
Collaborator Author

In #16161 I used fs and ENVIRONMENT_IS_NODE inside of worker.js in threadPrintErr. Prior to that change those variables were not refercened of threadPrintErr.

In order to make sure that err (threadPrintErr) can be used from the very beginning (before the main js file is loaded), we need to define those here.

The added log message in the PR fails without this change.

@sbc100

sbc100 commented Feb 1, 2022

Copy link
Copy Markdown
Collaborator Author

The compiler.js change is just an inconsistency I noticed when grepping for nodeFS. I can split it out if you like?

@kripken kripken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see, thanks, I missed that recent change.

No need to split out that other part, looks trivial and correct.

@sbc100
sbc100 disabled auto-merge February 1, 2022 18:50
@sbc100
sbc100 merged commit c1e2036 into main Feb 1, 2022
@sbc100
sbc100 deleted the fix_threadPrintErr branch February 1, 2022 18:50
@sbc100 sbc100 changed the title Use for early use of threadPrintErr Fix for early use of threadPrintErr Feb 3, 2022
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