helpers.registerVariable, variable blocks
This commit is contained in:
parent
52c77e93dc
commit
fdabcd552e
3 changed files with 4 additions and 0 deletions
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('#types').BlockDefinitionRaw} */
|
||||
export default {
|
||||
type: 'io_variables_get',
|
||||
bytecodeKey: "getVariable",
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('#types').BlockDefinitionRaw} */
|
||||
export default {
|
||||
type: 'io_variables_set',
|
||||
bytecodeKey: "setVariable",
|
||||
|
|
@ -36,6 +37,7 @@ export default {
|
|||
const
|
||||
defaultedValue = value
|
||||
? JSON.parse(value)
|
||||
// TODO: is this !== 0 check superfluous?
|
||||
: (value !== 0 && value !== null) && null,
|
||||
blockPayload = JSON.stringify({
|
||||
setVariable: {
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
* @typedef {object} BlockRegeneratorHelpers
|
||||
* @property {function} expressionToBlock
|
||||
* @property {function} arrayToStatements
|
||||
* @property {function} registerVariable
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue