@@ -406,6 +406,7 @@ function Runtime() {
406
406
"$superClass" ,
407
407
"$class" ,
408
408
"$className" ,
409
+ "$moduleName" ,
409
410
"$protocols" ,
410
411
"$methods" ,
411
412
"$ownMethods" ,
@@ -419,6 +420,7 @@ function Runtime() {
419
420
let cachedSuperClass = null ;
420
421
let cachedClass = null ;
421
422
let cachedClassName = null ;
423
+ let cachedModuleName = null ;
422
424
let cachedProtocols = null ;
423
425
let cachedMethodNames = null ;
424
426
let cachedProtocolMethods = null ;
@@ -518,6 +520,11 @@ function Runtime() {
518
520
cachedClassName = api . object_getClassName ( handle ) . readUtf8String ( ) ;
519
521
}
520
522
return cachedClassName ;
523
+ case "$moduleName" :
524
+ if ( cachedModuleName === null ) {
525
+ cachedModuleName = api . class_getImageName ( classHandle ( ) ) . readUtf8String ( ) ;
526
+ }
527
+ return cachedModuleName ;
521
528
case "$protocols" :
522
529
if ( cachedProtocols === null ) {
523
530
cachedProtocols = { } ;
@@ -2674,6 +2681,7 @@ function getApi() {
2674
2681
"objc_registerClassPair" : [ 'void' , [ 'pointer' ] ] ,
2675
2682
"class_isMetaClass" : [ 'bool' , [ 'pointer' ] ] ,
2676
2683
"class_getName" : [ 'pointer' , [ 'pointer' ] ] ,
2684
+ "class_getImageName" : [ 'pointer' , [ 'pointer' ] ] ,
2677
2685
"class_copyProtocolList" : [ 'pointer' , [ 'pointer' , 'pointer' ] ] ,
2678
2686
"class_copyMethodList" : [ 'pointer' , [ 'pointer' , 'pointer' ] ] ,
2679
2687
"class_getClassMethod" : [ 'pointer' , [ 'pointer' , 'pointer' ] ] ,
0 commit comments