Maker: Don't show error overlay when running empty program #14465
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.
Maker used to display its connection failure overlay when running an empty program, even connection to the board normally succeeds. Now it runs the empty program without complaint.
Root cause
Because JavaScript empty string
""
is falsy, App Lab was not creating an Interpreter at all for empty programs. When this happened with Maker enabled, board connection would fail because part of the connection process is injecting board components into the interpreter, and Maker always assumed it was passed a valid interpreter.After this change, App Lab does create an interpreter for empty programs, which seems like correct behavior to me (there should always be an interpreter if App Lab is "running"). This also has a subtle effect on the debug console, which I would also consider a bugfix:
Follow-up work
We might also be able to remove this conditional from
Applab.onTick
but I wanted to start with the minimum change to fix this issue first.