Newer versions of `tap` run more asynchronously, so sometimes using `process.nextTick(process.exit)`
to end a test would prevent the test from completing correctly. Removing all instances of
`process.nextTick(process.exit)` put tests into three categories:
* the test still worked correctly -- no fixup needed.
* the test would hang because the VM's `_steppingInterval` was keeping
Node alive. These tests call a new `quit()` method which ends the
stepping interval.
* the `load-extensions` test needed special attention because the "Video
Sensing" extension starts its own loop using `setTimeout`. I added a
`_stopLoop()` method on the extension and directly call that from the
test. I'm not completely happy with this solution but anything more
general would likely require a change to the extension spec, so I'm
leaving that as a followup task.
Sometimes a single extension method needs to service several different
instances of the same opcode. This can happen with variables or custom
procedures, for example. This change allows the extension method to
inspect the `blockInfo` for instance data, including arbitrary
extension-specific properties if necessary.
Reduce the amount of code that needs to evaluated before we can
starting the target project if there is one. It is key to note that the
music extension includes ~2MB of base64 encoded sound samples. This
skips evaluating those samples and decoding base64 into binary typed
arrays.
Convert refreshBlocks to a function returning a promise, and return that from setLocale. Now GUI can ensure that refreshing the toolbox and workspace only happens after all the blocks have refreshed.
* Add micro:bit Scratch 3.0 extension
* Fix lint errors in micro:bit extension
* Fix doc. Incorrect return type
* Check for valid pin in when pin connected block
* Drop mapping function
* Drop question mark from tilt hat block
* Generate list of symbols from object keys
* Trim display text block to max 20 characters
The new `maybeFormatMessage` function detects whether its argument
looks like a message descriptor object and, if so, will call
`formatMessage` on it. This is now used for all user-visible text fields
in extensions.
Also, messages may use "select" to check the target type with a message
like this: '{targetType, select, stage {text for stage} sprite {text for
sprite} other {text for other}'. Note that the "other" clause is
required by `formatMessage`.