File tree 1 file changed +12
-14
lines changed
1 file changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -91,9 +91,6 @@ newSuite("combined")
91
91
. run ( ) ;
92
92
93
93
var json = require ( "../tests/data/test.json" ) ;
94
- var fromJsonRoot = protobuf . Root . fromJSON ( json ) ;
95
- var fromJsonIndex = 1 ;
96
-
97
94
newSuite ( "fromJSON" )
98
95
. add ( "isolated" , function ( ) {
99
96
protobuf . Root . fromJSON ( json ) ;
@@ -102,20 +99,21 @@ newSuite("fromJSON")
102
99
protobuf . Root . fromJSON ( json ) . resolveAll ( ) ;
103
100
} )
104
101
. 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
+ }
115
114
} ) . run ( ) ;
116
115
117
116
var resolveAllRoot = protobuf . Root . fromJSON ( json ) ;
118
-
119
117
newSuite ( "resolveAll" )
120
118
. add ( "isolated" , function ( ) {
121
119
resolveAllRoot . resolveAll ( ) ;
You can’t perform that action at this time.
0 commit comments