coderespawn / dock-spawn

Dock Spawn is a web based dock layout engine that aids in creating flexible user interfaces by enabling panels to be docked on the screen similar to Visual Studio IDE
http://dockspawn.com
MIT License
255 stars 76 forks source link

Cannot call method 'forEach' of undefined #13

Open drewnoakes opened 10 years ago

drewnoakes commented 10 years ago

In the following code:

dockspawn.DockGraphSerializer.prototype._buildGraphInfo = function(node)
{
    var nodeState = {};
    node.container.saveState(nodeState);

    var childrenInfo = [];
    var self = this;
    node.childNodes.forEach(function(childNode) {         // BANG!!!
        childrenInfo.push(self._buildGraphInfo(childNode));
    });

    var nodeInfo = {};
    nodeInfo.containerType = node.container.containerType;
    nodeInfo.state = nodeState;
    nodeInfo.children = childrenInfo;
    return nodeInfo;
};

Where is node.childNodes defined? Looking through the source code, there's no other reference to that property.