mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 15:02:52 -05:00
Some code cleanup.
This commit is contained in:
parent
3f444138db
commit
386045f033
3 changed files with 4 additions and 4 deletions
|
@ -87,7 +87,7 @@ class Target extends EventEmitter {
|
||||||
const variable = this.lookupVariableById(id);
|
const variable = this.lookupVariableById(id);
|
||||||
if (variable) return variable;
|
if (variable) return variable;
|
||||||
// No variable with this name exists - create it locally.
|
// No variable with this name exists - create it locally.
|
||||||
const newVariable = new Variable(id, name, '', false);
|
const newVariable = new Variable(id, name, Variable.SCALAR_TYPE, false);
|
||||||
this.variables[id] = newVariable;
|
this.variables[id] = newVariable;
|
||||||
return newVariable;
|
return newVariable;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ class Variable {
|
||||||
/**
|
/**
|
||||||
* @param {string} id Id of the variable.
|
* @param {string} id Id of the variable.
|
||||||
* @param {string} name Name of the variable.
|
* @param {string} name Name of the variable.
|
||||||
* @param {(string|number)} type Type of the variable, one of "" or "list"
|
* @param {string} type Type of the variable, one of '' or 'list'
|
||||||
* @param {boolean} isCloud Whether the variable is stored in the cloud.
|
* @param {boolean} isCloud Whether the variable is stored in the cloud.
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -234,7 +234,7 @@ const parseScratchObject = function (object, runtime, extensions, topLevel) {
|
||||||
const newVariable = new Variable(
|
const newVariable = new Variable(
|
||||||
getVariableId(variable.name),
|
getVariableId(variable.name),
|
||||||
variable.name,
|
variable.name,
|
||||||
'',
|
Variable.SCALAR_TYPE,
|
||||||
variable.isPersistent
|
variable.isPersistent
|
||||||
);
|
);
|
||||||
newVariable.value = variable.value;
|
newVariable.value = variable.value;
|
||||||
|
@ -254,7 +254,7 @@ const parseScratchObject = function (object, runtime, extensions, topLevel) {
|
||||||
const newVariable = new Variable(
|
const newVariable = new Variable(
|
||||||
getVariableId(list.listName),
|
getVariableId(list.listName),
|
||||||
list.listName,
|
list.listName,
|
||||||
'list',
|
Variable.LIST_TYPE,
|
||||||
list.isPersistent
|
list.isPersistent
|
||||||
);
|
);
|
||||||
newVariable.value = list.contents;
|
newVariable.value = list.contents;
|
||||||
|
|
Loading…
Reference in a new issue