This ensures that wrapper around node argument sent to the transformation
is using path only the first time it needs to, not every time
after first run of the transformation.
});
this.document = document;
});
this.document = document;
if(desc.init) {
desc.init.call(this);
}
if(desc.init) {
desc.init.call(this);
}
}
var argsToPass = desc.undo ? [this].concat(this.args) : this.args;
var toret = desc.impl.apply(this.context, argsToPass);
}
var argsToPass = desc.undo ? [this].concat(this.args) : this.args;
var toret = desc.impl.apply(this.context, argsToPass);
return toret;
},
undo: function() {
return toret;
},
undo: function() {
},
wrapNodeProperty: function(object, propName, value) {
var transformation = this,
},
wrapNodeProperty: function(object, propName, value) {
var transformation = this,
path;
value = value || object[propName];
path;
value = value || object[propName];
path = value.getPath();
Object.defineProperty(object, propName, {
get: function() {
path = value.getPath();
Object.defineProperty(object, propName, {
get: function() {
- if(transformation.hasRun && path) {
- return transformation.document.getNodeByPath(path);
- } else {
- return value;
+ if((lastRunNumber !== transformation.runCount) && path) {
+ value = transformation.document.getNodeByPath(path);
+ lastRunNumber = transformation.runCount;