@@ -42,19 +42,20 @@ var LibraryEmbind = {
42
42
printFunction ( nameMap , out ) {
43
43
out . push ( `${ this . name } ` ) ;
44
44
this . printSignature ( nameMap , out ) ;
45
- out . push ( ';\n' ) ;
46
45
}
47
46
48
47
printModuleEntry ( nameMap , out ) {
49
48
out . push ( ' ' ) ;
50
49
this . printFunction ( nameMap , out ) ;
50
+ out . push ( ';\n' ) ;
51
51
}
52
52
} ,
53
53
$ClassDefinition : class ClassDefinition {
54
54
constructor ( typeId , name , base = null ) {
55
55
this . typeId = typeId ;
56
56
this . name = name ;
57
57
this . methods = [ ] ;
58
+ this . staticMethods = [ ] ;
58
59
this . constructors = [
59
60
new FunctionDefinition ( 'default' , this , [ ] )
60
61
] ;
@@ -75,6 +76,7 @@ var LibraryEmbind = {
75
76
for ( const method of this . methods ) {
76
77
out . push ( ' ' ) ;
77
78
method . printFunction ( nameMap , out ) ;
79
+ out . push ( ';\n' ) ;
78
80
}
79
81
out . push ( ' delete(): void;\n' ) ;
80
82
out . push ( '}\n\n' ) ;
@@ -85,6 +87,10 @@ var LibraryEmbind = {
85
87
// TODO Handle constructor overloading
86
88
const constructor = this . constructors [ this . constructors . length > 1 ? 1 : 0 ] ;
87
89
constructor . printSignature ( nameMap , out ) ;
90
+ for ( const method of this . staticMethods ) {
91
+ out . push ( '; ' ) ;
92
+ method . printFunction ( nameMap , out ) ;
93
+ }
88
94
out . push ( '};\n' ) ;
89
95
}
90
96
} ,
@@ -376,6 +382,23 @@ var LibraryEmbind = {
376
382
return [ ] ;
377
383
} ) ;
378
384
} ,
385
+ _embind_register_class_class_function__deps : [ '$createFunctionDefinition' ] ,
386
+ _embind_register_class_class_function : function ( rawClassType ,
387
+ methodName ,
388
+ argCount ,
389
+ rawArgTypesAddr ,
390
+ invokerSignature ,
391
+ rawInvoker ,
392
+ fn ,
393
+ isAsync ) {
394
+ whenDependentTypesAreResolved ( [ ] , [ rawClassType ] , function ( classType ) {
395
+ classType = classType [ 0 ] ;
396
+ createFunctionDefinition ( methodName , argCount , rawArgTypesAddr , false , ( funcDef ) => {
397
+ classType . staticMethods . push ( funcDef ) ;
398
+ } ) ;
399
+ return [ ] ;
400
+ } ) ;
401
+ } ,
379
402
_embind_register_enum__deps : [ '$readLatin1String' , '$EnumDefinition' , '$moduleDefinitions' ] ,
380
403
_embind_register_enum : function ( rawType , name , size , isSigned ) {
381
404
name = readLatin1String ( name ) ;
0 commit comments