@@ -119,7 +119,6 @@ Object.keys(descriptor).forEach(function(fileName, index) {
119119 return "../include/" + file + ".h" ;
120120 } ) ;
121121
122- /*
123122
124123 // Add to the type's list if it's new.
125124 typeMap [ "const " + "git_" + fileName + " *" ] =
@@ -134,14 +133,19 @@ Object.keys(descriptor).forEach(function(fileName, index) {
134133 file . functions = libgit2 . files [ index ] . functions . map ( function ( functionName , index ) {
135134 var funcDescriptor = libgit2 . functions [ functionName ] ;
136135 var descriptor = legacyFile . functions ? legacyFile . functions [ index ] || { } : { } ;
137- var cType = file.cType || "";
136+ var cType = file . cType || "git " ;
138137
139138 if ( ! functionName || ! funcDescriptor ) { return ; }
140139
141140 descriptor . cFunctionName = functionName ;
141+ descriptor . ignore = true ;
142142
143143 var trimmedName = functionName . slice ( cType . length + 1 ) ;
144144
145+ if ( trimmedName === "new" ) {
146+ trimmedName = "new2" ;
147+ }
148+
145149 descriptor . cppFunctionName = titleCase ( trimmedName ) ;
146150 descriptor . jsFunctionName = camelCase ( trimmedName ) ;
147151
@@ -154,9 +158,9 @@ Object.keys(descriptor).forEach(function(fileName, index) {
154158 } ;
155159
156160 var retVal = descriptor . return = { } ;
157- retVal.ctype = funcDescriptor.return.type;
161+ retVal . cType = funcDescriptor . return . type ;
158162
159- var type = typeMap[retVal.ctype ];
163+ var type = typeMap [ retVal . cType ] ;
160164 retVal . cppClassName = type . cpp ;
161165 retVal . jsClassName = type . js ;
162166
@@ -185,9 +189,11 @@ Object.keys(descriptor).forEach(function(fileName, index) {
185189 return descriptor ;
186190 } ) ;
187191
188- */
189192 files . push ( file ) ;
190193} ) ;
191194
195+ fs . writeFileSync ( path . join ( __dirname , "types.json" ) ,
196+ JSON . stringify ( typeMap , null , 2 ) ) ;
197+
192198fs . writeFileSync ( path . join ( __dirname , "compare.json" ) ,
193199 JSON . stringify ( files , null , 2 ) ) ;
0 commit comments