We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8dd35ca commit 7466134Copy full SHA for 7466134
test/node/map_tests.js
@@ -104,3 +104,18 @@ exports['should serialize a map'] = function(test) {
104
var data = bson.serialize(m, false, true);
105
test.equal('13000000103100010000001030000200000000', data.toString('hex'));
106
}
107
+
108
+/**
109
+ * @ignore
110
+ */
111
+exports['should not crash due to object that looks like map'] = function(test) {
112
+ // Serialize top level map only
113
+ var m = { entries: "test" };
114
+ var bson = createBSON();
115
+ // Serialize the map
116
+ var data = bson.serialize(m, false, true);
117
+ // Deserialize the data
118
+ var object = bson.deserialize(data);
119
+ test.deepEqual(m, object);
120
+ test.done();
121
+}
0 commit comments