mirror of
https://github.com/konvajs/konva.git
synced 2025-12-29 18:34:36 +08:00
fix toObject for extended attrs. close #86
This commit is contained in:
@@ -3015,4 +3015,15 @@ suite('Node', function() {
|
||||
};
|
||||
imageObj.src = 'assets/darth-vader.jpg';
|
||||
});
|
||||
|
||||
test('toObject with extended prototypes', function() {
|
||||
var node = new Konva.Circle({
|
||||
id: 'foo',
|
||||
radius: 10
|
||||
});
|
||||
Number.prototype.customFunc = function() {};
|
||||
console.dir(node.toObject());
|
||||
assert.equal(node.toObject().attrs.radius, 10);
|
||||
delete Number.prototype.customFunc;
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user