File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -324,6 +324,9 @@ var Helpers = {
324324 }
325325 } ) . value ( ) ;
326326
327+ if ( "git_" + typeDef . typeName == fnDef . cFunctionName ) {
328+ fnDef . useAsOnRootProto = true ;
329+ }
327330 _ . merge ( fnDef , _ . omit ( fnOverrides , "args" , "return" ) ) ;
328331 } ,
329332
Original file line number Diff line number Diff line change @@ -66,6 +66,29 @@ var importExtension = function(name) {
6666//must go last!
6767require ( "./enums" ) ;
6868
69+ /* jshint ignore:start */
70+ { % each . as idef % }
71+ { % if idef . type != "enum" % }
72+ { % each idef . functions as fn % }
73+
74+ { % if fn . useAsOnRootProto % }
75+ // Inherit directly from the original {{idef.jsClassName}} object.
76+ _ { { idef . jsClassName } } . { { fn . jsFunctionName } } . __proto__ =
77+ _ { { idef . jsClassName } } ;
78+
79+ // Ensure we're using the correct prototype.
80+ _ { { idef . jsClassName } } . { { fn . jsFunctionName } } . prototype =
81+ _ { { idef . jsClassName } } . prototype ;
82+
83+ // Assign the function as the root
84+ rawApi . { { idef . jsClassName } } =
85+ _ { { idef . jsClassName } } . { { fn . jsFunctionName } } ;
86+ { % endif % }
87+ { % endeach % }
88+ { % endif % }
89+ { % endeach % }
90+ /* jshint ignore:end */
91+
6992// Wrap asynchronous methods to return promises.
7093promisify ( exports ) ;
7194
You can’t perform that action at this time.
0 commit comments