File tree Expand file tree Collapse file tree 1 file changed +12
-14
lines changed
Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -91,9 +91,6 @@ newSuite("combined")
9191.run();
9292
9393var json = require("../tests/data/test.json");
94- var fromJsonRoot = protobuf.Root.fromJSON(json);
95- var fromJsonIndex = 1;
96-
9794newSuite("fromJSON")
9895.add("isolated", function() {
9996 protobuf.Root.fromJSON(json);
@@ -102,20 +99,21 @@ newSuite("fromJSON")
10299 protobuf.Root.fromJSON(json).resolveAll();
103100})
104101.add("shared (unique)", function() {
105- var jsonCopy = {
106- options: json.options,
107- nested: {}
108- };
109- Object.keys(json).forEach(key => {
110- jsonCopy.nested[key + fromJsonIndex] = json[key]
111- });
112- fromJsonIndex++;
113-
114- protobuf.Root.fromJSON(jsonCopy, fromJsonRoot);
102+ var root = protobuf.Root.fromJSON(json);
103+ for (var i = 0; i < 1000; ++i) {
104+ var jsonCopy = {
105+ options: json.options,
106+ nested: {}
107+ };
108+ Object.keys(json).forEach(key => {
109+ jsonCopy.nested[key + i] = json[key];
110+ });
111+
112+ protobuf.Root.fromJSON(jsonCopy, root);
113+ }
115114}).run();
116115
117116var resolveAllRoot = protobuf.Root.fromJSON(json);
118-
119117newSuite("resolveAll")
120118.add("isolated", function() {
121119 resolveAllRoot.resolveAll();
You can’t perform that action at this time.
0 commit comments