@@ -931,24 +931,14 @@ bool ExportDefaultMethod(TypeInfo *type) {
931
931
bool InitMembers (TypeInfo *type) {
932
932
auto *ns = (Namespace *) type->tp_map ;
933
933
934
- if (type->object == nullptr )
935
- return true ;
936
-
937
- // Function/Method
938
- if (type->object ->methods != nullptr ) {
939
- for (const FunctionDef *cursor = type->object ->methods ; cursor->name != nullptr ; cursor++) {
940
- auto *fn = (ArObject *) FunctionNew (cursor, type, nullptr );
941
- if (fn == nullptr )
942
- return false ;
934
+ if (!NamespaceNewSymbol (ns, " __name" , type->name , AttributeFlag::CONST | AttributeFlag::PUBLIC))
935
+ return false ;
943
936
944
- if (!NamespaceNewSymbol (ns, cursor->name , fn, AttributeFlag::CONST | AttributeFlag::PUBLIC)) {
945
- Release (fn);
946
- return false ;
947
- }
937
+ if (!NamespaceNewSymbol (ns, " __qname" , type->qname , AttributeFlag::CONST | AttributeFlag::PUBLIC))
938
+ return false ;
948
939
949
- Release (fn);
950
- }
951
- }
940
+ if (type->object == nullptr )
941
+ return true ;
952
942
953
943
// Members
954
944
if (type->object ->members != nullptr ) {
@@ -966,6 +956,22 @@ bool InitMembers(TypeInfo *type) {
966
956
}
967
957
}
968
958
959
+ // Function/Method
960
+ if (type->object ->methods != nullptr ) {
961
+ for (const FunctionDef *cursor = type->object ->methods ; cursor->name != nullptr ; cursor++) {
962
+ auto *fn = (ArObject *) FunctionNew (cursor, type, nullptr );
963
+ if (fn == nullptr )
964
+ return false ;
965
+
966
+ if (!NamespaceNewSymbol (ns, cursor->name , fn, AttributeFlag::CONST | AttributeFlag::PUBLIC)) {
967
+ Release (fn);
968
+ return false ;
969
+ }
970
+
971
+ Release (fn);
972
+ }
973
+ }
974
+
969
975
return true ;
970
976
}
971
977
@@ -1119,7 +1125,7 @@ bool argon::vm::datatype::TypeOF(const ArObject *object, const TypeInfo *type) {
1119
1125
if (AR_TYPEOF (object, type))
1120
1126
return true ;
1121
1127
1122
- return TraitIsImplemented ( AR_GET_TYPE (object), type);
1128
+ return TraitIsImplemented (AR_GET_TYPE (object), type);
1123
1129
}
1124
1130
1125
1131
int argon::vm::datatype::MonitorAcquire (ArObject *object) {
0 commit comments