diff options
| author | jmoenig <jens@moenig.org> | 2014-09-17 14:40:39 +0200 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2014-09-17 14:40:39 +0200 |
| commit | 04168220bde4cdfa82e570dcb8d098653a4fcb7a (patch) | |
| tree | 99937a5105d288471eec4e51ff55eadf298dd8b7 /store.js | |
| parent | 8f7d1833f6e6b304e706bb84848dbf86a80834c8 (diff) | |
| download | snap-04168220bde4cdfa82e570dcb8d098653a4fcb7a.tar.gz snap-04168220bde4cdfa82e570dcb8d098653a4fcb7a.zip | |
Refactor variables handling
introducing Variable objects, all functionality stays the same at this
time
Diffstat (limited to 'store.js')
| -rw-r--r-- | store.js | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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('<variable name="@"/>', v); |
