1
0
Fork 0

Graph: Fixed `getVertices`

This commit is contained in:
Lucas Dohmen 2013-11-20 15:37:13 +01:00
parent fb9f9f7d26
commit 2024bdf941
3 changed files with 15 additions and 1 deletions

View File

@ -319,6 +319,8 @@ Graph.prototype.getVertices = function () {
wrapper = function(object) {
return new Vertex(graph, object);
};
return new Iterator(wrapper, cursor, "[edge iterator]");
};
////////////////////////////////////////////////////////////////////////////////

View File

@ -209,6 +209,18 @@ function GraphBasicsSuite() {
assertEqual(23, v2.getProperty("age"));
},
////////////////////////////////////////////////////////////////////////////////
/// @brief get all vertices
////////////////////////////////////////////////////////////////////////////////
testGetAllVertices : function () {
var v1 = graph.addVertex("my_vertex", { test: 123 }),
vertices = graph.getVertices(),
v2 = vertices.next();
assertEqual(v1.getProperty('test'), v2.getProperty('test'));
},
////////////////////////////////////////////////////////////////////////////////
/// @brief replace a vertex
////////////////////////////////////////////////////////////////////////////////

View File

@ -667,7 +667,7 @@ Graph.prototype.getVertices = function () {
return graph.constructVertex(object);
};
return new Iterator(wrapper, graph.constructVertex, "[edge iterator]");
return new Iterator(wrapper, all, "[edge iterator]");
};
////////////////////////////////////////////////////////////////////////////////