mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-03-13 17:04:39 -04:00
Fixup from comments
This commit is contained in:
parent
979ed66594
commit
ce94144051
2 changed files with 5 additions and 1 deletions
|
@ -274,7 +274,7 @@ const compressInputTree = function (block, blocks) {
|
|||
/**
|
||||
* Get non-core extension ID for a given sb3 opcode.
|
||||
* @param {!string} opcode The opcode to examine for extension.
|
||||
* @return {?string} The extension ID, if it exists/is not a core extension.
|
||||
* @return {?string} The extension ID, if it exists and is not a core extension.
|
||||
*/
|
||||
const getExtensionIdForOpcode = function (opcode) {
|
||||
const index = opcode.indexOf('_');
|
||||
|
|
|
@ -230,5 +230,9 @@ test('getExtensionIdForOpcode', t => {
|
|||
|
||||
// only considers things before the first underscore
|
||||
t.equal(sb3.getExtensionIdForOpcode('hello_there_loopy'), 'hello');
|
||||
|
||||
// does not return anything for opcodes with no extension
|
||||
t.false(sb3.getExtensionIdForOpcode('hello'));
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue