google / google/codeworld

Block UI errors could generate 'undefined' instead of errors

Open
#289 0 comments 0 reactions 0 assignees View on GitHub
discussion funblocks
Dominant language
Haskell
Stars
1.3k
Forks
201
PR merge metrics
No merged PRs in 30d

Description

Currently, missing blocks generate empty strings in codegen, leading to code that doesn't compile. Instead, they and other errors that break code generation could generate `undefined`, which would lead to runnable code. There are a few possibilities:
1. Generate the code with undefined, but still refuse to run it. I'd probably want to accompany this with different syntax highlighting for `undefined` to make it clear that it's a placeholder for an error.
2. Generate and actually run the code! Add a regexp matcher that replaces the resulting runtime errors with clearer ones and highlights or flashes the blocks that are responsible. This requires some kind of map from source locations to blocks, which could be tricky to build -- but which would also be awesome.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.