Allow controlling addon block return shape

This commit is contained in:
Muffin committed 2023-07-26 20:39:23 -05:00
1 parent 8cd117ce45
commit d3d3cfe6e3
1 file changed
+3 -1
+3 -1
View File
@@ -2588,7 +2588,8 @@ class Runtime extends EventEmitter {
* @param {string} options.procedureCode The ID of the block
* @param {function} options.callback The callback, called with (args, BlockUtility). May return a promise.
* @param {string[]} [options.arguments] Names of the arguments accepted. Optional if no arguments.
* @param {boolean} [hidden] True to not include this block in the block palette
* @param {boolean} [options.hidden] True to not include this block in the block palette
* @param {1|2} [options.return] 1 for round reporter, 2 for boolean reported, leave empty for statement.
*/
addAddonBlock (options) {
const procedureCode = options.procedureCode;
@@ -2633,6 +2634,7 @@ class Runtime extends EventEmitter {
` argumentnames="${xmlEscape(JSON.stringify(names))}"` +
` argumentids="${xmlEscape(JSON.stringify(ids))}"` +
` argumentdefaults="${xmlEscape(JSON.stringify(defaults))}"` +
`${options.return ? ` return="${xmlEscape(options.return.toString())}"` : ''}` +
'></mutation></block>'
});
}