This repository was archived by the owner on Oct 1, 2020. It is now read-only.
Fixes #149 by adding a 30-pass limit to recursion...#276
Open
crdrost wants to merge 2 commits intoelectron-userland:masterfrom
Open
Fixes #149 by adding a 30-pass limit to recursion...#276crdrost wants to merge 2 commits intoelectron-userland:masterfrom
crdrost wants to merge 2 commits intoelectron-userland:masterfrom
Conversation
…d stopping immediately on loops.
MarshallOfSound
suggested changes
Nov 21, 2017
Member
MarshallOfSound
left a comment
There was a problem hiding this comment.
In general seems like a good thing, just some performance / optimization things
src/compiler-host.js
Outdated
| * @private | ||
| */ | ||
| async compileUncached(filePath, hashInfo, compiler) { | ||
| async compileUncached(filePath, hashInfo, compiler, history=[]) { |
Member
There was a problem hiding this comment.
To make this slightly faster we should just use a Set instead of an array
src/compiler-host.js
Outdated
| // Got something we can use in-browser, let's return it | ||
| return Object.assign(result, {dependentFiles}); | ||
| } else if (history.indexOf(result.code) !== -1) { | ||
| d(`Compiler loop, I have seen this source before: ${JSON.stringify(result)}`); |
Member
There was a problem hiding this comment.
We shouldn't log the compiler result, that's a lot of info to pipe to stdout
src/compiler-host.js
Outdated
| d(`Compiler loop, I have seen this source before: ${JSON.stringify(result)}`); | ||
| return Object.assign(result, {dependentFiles}); | ||
| } else if (history.length > 30) { | ||
| d(`Runaway compilation: ${JSON.stringify({history: history, result: result})}`); |
Member
There was a problem hiding this comment.
Same here, piping a lot of stuff to stdout actually takes a long time
Author
|
Better? |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
... and stopping immediately on loops.
In order to support
passthrough, on loops we still return whatever the dependent file was, even though we "cannot use it". Anything else would make the term "passthrough" very strange for what we're doing there. But this might not be a sane default for other compilers which get stuck in self-reference loops.