Merge pull request #22 from Byron/micro-improvements

cleanup special 'definedProperties' field in Node
This commit is contained in:
Jeff Avallone 2016-01-30 16:41:53 -05:00
commit 340413a27c
2 changed files with 4 additions and 1 deletions

View File

@ -26,7 +26,7 @@ describe('parser/javascript/node.js', function() {
expect(setup).toHaveBeenCalled();
});
it('sets up any defined properties', function() {
it('sets up any defined properties and removes \'definedProperties\' field', function() {
this.node.module = {
definedProperties: {
example: {
@ -37,6 +37,7 @@ describe('parser/javascript/node.js', function() {
}
};
expect(this.node.example).toEqual('value');
expect(this.node.definedProperties).toBeUndefined();
});
});

View File

@ -30,6 +30,8 @@ export default class Node {
_.forOwn(this.definedProperties || {}, (methods, name) => {
Object.defineProperty(this, name, methods);
});
delete this.definedProperties;
}
// The SVG element to render this node into. A node-type class is