Prevent Item#importJSON() from overriding Item#insert()

Closes #1392
This commit is contained in:
sasensi 2018-11-05 18:11:13 +01:00 committed by Jürg Lehni
parent eeb26436b0
commit 0eae0b6e4d
3 changed files with 17 additions and 1 deletions

View file

@ -256,3 +256,10 @@ test('Path#importJSON()', function() {
equals(function() { return layer.firstChild === path; }, true);
equals(function() { return path.parent === layer; }, true);
});
test('Item#importJSON() does not override Item#insert()', function() {
var path = new Path();
equals(typeof path.insert, 'function');
path.importJSON(path.exportJSON());
equals(typeof path.insert, 'function');
});