Isaacs/do not break on missing global process#297
Merged
LinusU merged 3 commits intoevanw:masterfrom Sep 9, 2021
Merged
Conversation
This was occasionally causing my machine to spin on CPU indefinitely while trying to download the Closure Compiler output. It would perhaps be better to investigate what is wrong with curl on my machine, but since Node has a pretty nice built-in HTTPS client, I figured it'd be easier to just cut out the external system dependency entirely.
fs.writeFileSync no longer stringifies arguments, instead throwing if it receives something that is not a proper String or Buffer.
Contributor
Author
|
me: "What idiot made it look at also me: #255 😂 (I'm j/k, of course, no hostility about bugs.) |
isaacs
commented
Aug 31, 2021
| fs.writeFileSync('browser-source-map-support.js', code); | ||
| fs.writeFileSync('amd-test/browser-source-map-support.js', code); | ||
| console.log('making request to google closure compiler'); | ||
| var https = require('https'); |
Contributor
Author
There was a problem hiding this comment.
I considered stashing the response in node_modules/.cache somewhere and only making the request if the input file changed since the last one, but figured that might be overkill?
Collaborator
There was a problem hiding this comment.
Yeah, I think that we should replace this with a local build system anyways, so no worries for now
This is the last item preventing node-tap from being browser-friendly. Since global.process is safely guarded in other instances where it is used, this seems like an oversight.
f63cbbe to
dd868f6
Compare
Contributor
Author
|
Updated to also not break if |
Collaborator
|
Released as |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
processis unset or null.