Fixup from comments

This commit is contained in:
Paul Kaplan 2018-11-07 10:11:16 -05:00
parent 979ed66594
commit ce94144051
2 changed files with 5 additions and 1 deletions

View file

@ -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('_');

View file

@ -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();
});