Allow controlling addon block return shape
This commit is contained in:
1 parent
8cd117ce45
commit
d3d3cfe6e3
1 file changed
+3
-1
@@ -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>'
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user