Updated variables and var_fire event listener.

This commit is contained in:
marisaleung 2017-06-15 14:29:15 -07:00
parent d9704b23c3
commit 875ccf5b88
10 changed files with 216 additions and 28 deletions
src/serialization

View file

@ -191,11 +191,13 @@ const parseScratchObject = function (object, runtime, topLevel) {
if (object.hasOwnProperty('variables')) {
for (let j = 0; j < object.variables.length; j++) {
const variable = object.variables[j];
target.variables[variable.name] = new Variable(
const newVariable = new Variable(
null,
variable.name,
variable.value,
variable.isPersistent
);
target.variables[newVariable.id] = newVariable;
}
}
if (object.hasOwnProperty('lists')) {

View file

@ -98,11 +98,13 @@ const parseScratchObject = function (object, runtime) {
if (object.hasOwnProperty('variables')) {
for (let j = 0; j < object.variables.length; j++) {
const variable = object.variables[j];
target.variables[variable.name] = new Variable(
const newVariable = new Variable(
variable.id,
variable.name,
variable.value,
variable.isPersistent
);
target.variables[newVariable.id] = newVariable;
}
}
if (object.hasOwnProperty('lists')) {