Browse files

Some more fixes related to remixing

  • Loading branch information...
1 parent d621faf commit 085cb38ae38198a9996e7b06a8a2f655ad7439e6 Yaroslaff Fedin committed Apr 3, 2012
Showing with 6 additions and 9 deletions.
  1. +4 −6 Source/DOM/Element.js
  2. +1 −2 Source/DOM/Textnode.js
  3. +1 −1 Source/Object/Object.js
View
10 Source/DOM/Element.js
@@ -492,10 +492,9 @@ LSD.Element.prototype.__properties = {
}
},
parentNode: function(value, old, memo) {
- if (!value) {
- if (memo !== 'overwrite' && memo !== 'collapse') this.unset('sourceIndex', this.sourceIndex, memo);
- } else this.mix('variables', value.variables, memo, true, true);
- if (old) this.mix('variables', old.variables, memo, false, true)
+ if (!value && memo !== 'overwrite' && memo !== 'collapse')
+ this.unset('sourceIndex', this.sourceIndex, memo);
+ this.mix('variables', value && value.variables, memo, old && old.variables, true);
for (var property in this._inherited) {
if (value && value[property]) this.set(property, value[property], memo, true);
if (old && old[property]) this.unset(property, old[property], memo, true);
@@ -544,7 +543,7 @@ LSD.Element.prototype.__properties = {
children.textContent = text;
}
}
- this.mix('nodeValue', value, memo, old, true);
+ this.mix('nodeValue', value, memo, old, true, true);
},
/*
Different types of elements have different strategies to define value.
@@ -554,7 +553,6 @@ LSD.Element.prototype.__properties = {
*/
nodeValueProperty: function(value, old) {
if (value) this.watch(value, 'nodeValue');
- console.error([this.nodeValue, value, this.href])
if (old) this.unwatch(old, 'nodeValue');
},
src: 'request.url',
View
3 Source/DOM/Textnode.js
@@ -52,8 +52,7 @@ LSD.Textnode = LSD.Struct({
return new LSD.Script({type: 'function', name: 'concat', input: bits, pipable: false});
},
parentNode: function(value, old, memo) {
- if (value) this.mix('variables', value.variables, memo, true, true);
- if (old) this.mix('variables', old.variables, memo, false, true)
+ this.mix('variables', value && value.variables, memo, old && old.variables, true);
}
}, 'Journal');
LSD.Textnode.implement(LSD.Node.prototype);
View
2 Source/Object/Object.js
@@ -219,7 +219,7 @@ LSD.Object.prototype.unset = function(key, value, memo, index, hash) {
if (fn.call) fn.call(this, undefined, old);
else this._callback(fn, key, undefined, old, memo);
var stored = this._stored && this._stored[key];
- if (stored != null && value != null)
+ if (stored != null && value != null && value.unmix)
for (var i = 0, args, obj; args = stored[i++];)
if ((obj = args[0]) !== value && obj !== old)
if (!args[2] || !args[2]._delegate || !args[2]._delegate(value, key, undefined, memo, args[0]))

0 comments on commit 085cb38

Please sign in to comment.