better cloning of node: array copied as copy, nor reference

This commit is contained in:
Лаврёнов Антон
2014-03-08 10:50:53 +08:00
parent d65201a12f
commit 45ddf95629
2 changed files with 6 additions and 5 deletions

View File

@@ -437,15 +437,14 @@ suite('Node', function() {
});
var clone = line.clone({
stroke: 'green',
points : [10, 10, 20, 20, 30, 30]
stroke: 'green'
});
layer.add(clone);
stage.add(layer);
assert.equal(line.points().length, 4);
assert.equal(clone.points().length, 6);
assert.equal(line.points() === clone.points(), false);
assert.equal(clone.points().toString(), '0,0,10,10');
});
// ======================================================