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 {
|
export default {
|
||||||
type: 'io_variables_get',
|
type: 'io_variables_get',
|
||||||
bytecodeKey: "getVariable",
|
bytecodeKey: "getVariable",
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
/** @type {import('#types').BlockDefinitionRaw} */
|
||||||
export default {
|
export default {
|
||||||
type: 'io_variables_set',
|
type: 'io_variables_set',
|
||||||
bytecodeKey: "setVariable",
|
bytecodeKey: "setVariable",
|
||||||
|
|
@ -36,6 +37,7 @@ export default {
|
||||||
const
|
const
|
||||||
defaultedValue = value
|
defaultedValue = value
|
||||||
? JSON.parse(value)
|
? JSON.parse(value)
|
||||||
|
// TODO: is this !== 0 check superfluous?
|
||||||
: (value !== 0 && value !== null) && null,
|
: (value !== 0 && value !== null) && null,
|
||||||
blockPayload = JSON.stringify({
|
blockPayload = JSON.stringify({
|
||||||
setVariable: {
|
setVariable: {
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@
|
||||||
* @typedef {object} BlockRegeneratorHelpers
|
* @typedef {object} BlockRegeneratorHelpers
|
||||||
* @property {function} expressionToBlock
|
* @property {function} expressionToBlock
|
||||||
* @property {function} arrayToStatements
|
* @property {function} arrayToStatements
|
||||||
|
* @property {function} registerVariable
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue