From 04168220bde4cdfa82e570dcb8d098653a4fcb7a Mon Sep 17 00:00:00 2001 From: jmoenig Date: Wed, 17 Sep 2014 14:40:39 +0200 Subject: Refactor variables handling introducing Variable objects, all functionality stays the same at this time --- store.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'store.js') diff --git a/store.js b/store.js index f8d46bf..b743239 100644 --- a/store.js +++ b/store.js @@ -57,11 +57,11 @@ newCanvas, Costume, Sound, Audio, IDE_Morph, ScriptsMorph, BlockMorph, ArgMorph, InputSlotMorph, TemplateSlotMorph, CommandSlotMorph, FunctionSlotMorph, MultiArgMorph, ColorSlotMorph, nop, CommentMorph, isNil, localize, sizeOf, ArgLabelMorph, SVG_Costume, MorphicPreferences, -SyntaxElementMorph*/ +SyntaxElementMorph, Variable*/ // Global stuff //////////////////////////////////////////////////////// -modules.store = '2014-July-29'; +modules.store = '2014-September-17'; // XML_Serializer /////////////////////////////////////////////////////// @@ -730,8 +730,8 @@ SnapSerializer.prototype.loadVariables = function (varFrame, element) { return; } value = child.children[0]; - varFrame.vars[child.attributes.name] = value ? - myself.loadValue(value) : 0; + varFrame.vars[child.attributes.name] = new Variable(value ? + myself.loadValue(value) : 0); }); }; @@ -1509,7 +1509,7 @@ Sound.prototype.toXML = function (serializer) { VariableFrame.prototype.toXML = function (serializer) { var myself = this; return Object.keys(this.vars).reduce(function (vars, v) { - var val = myself.vars[v], + var val = myself.vars[v].value, dta; if (val === undefined || val === null) { dta = serializer.format('', v); -- cgit v1.3.1