@@ -81,25 +81,47 @@ export namespace TypeRef {
81
81
export const StringviewWTF8 = binaryen . _BinaryenTypeStringviewWTF8 ( ) ;
82
82
export const StringviewWTF16 = binaryen . _BinaryenTypeStringviewWTF16 ( ) ;
83
83
export const StringviewIter = binaryen . _BinaryenTypeStringviewIter ( ) ;
84
+ // bottom types
85
+ export const Noneref = binaryen . _BinaryenTypeNullref ( ) ;
86
+ export const Nofuncref = binaryen . _BinaryenTypeNullFuncref ( ) ;
87
+ export const Noexternref = binaryen . _BinaryenTypeNullExternref ( ) ;
84
88
85
89
export const Auto : TypeRef = - 1 /* _BinaryenTypeAuto */ ;
86
90
}
87
91
88
92
/** Reference to a Binaryen heap type. */
89
93
export type HeapTypeRef = binaryen . HeapTypeRef ;
90
94
export namespace HeapTypeRef {
95
+
96
+ // any extern func
97
+ // | | |
98
+ // __ eq __ noextern (...)
99
+ // / | \ |
100
+ // i31 struct array nofunc
101
+ // | | |
102
+ // none (...) (...)
103
+ // | |
104
+ // none none
105
+ //
106
+ // where (...) represents the concrete subtypes
107
+
91
108
// reference & GC heap types
92
- export const Ext : HeapTypeRef = binaryen . _BinaryenHeapTypeExt ( ) ;
109
+ export const Extern : HeapTypeRef = binaryen . _BinaryenHeapTypeExt ( ) ;
93
110
export const Func : HeapTypeRef = binaryen . _BinaryenHeapTypeFunc ( ) ;
94
111
export const Any : HeapTypeRef = binaryen . _BinaryenHeapTypeAny ( ) ;
95
112
export const Eq : HeapTypeRef = binaryen . _BinaryenHeapTypeEq ( ) ;
96
113
export const I31 : HeapTypeRef = binaryen . _BinaryenHeapTypeI31 ( ) ;
97
- export const Data : HeapTypeRef = binaryen . _BinaryenHeapTypeData ( ) ;
114
+ export const Data : HeapTypeRef = binaryen . _BinaryenHeapTypeData ( ) ; // TODO: struct
115
+ // export const Array: HeapTypeRef = binaryen._BinaryenHeapTypeArray(); // TODO
98
116
// string heap types
99
117
export const String : HeapTypeRef = binaryen . _BinaryenHeapTypeString ( ) ;
100
118
export const StringviewWTF8 : HeapTypeRef = binaryen . _BinaryenHeapTypeStringviewWTF8 ( ) ;
101
119
export const StringviewWTF16 : HeapTypeRef = binaryen . _BinaryenHeapTypeStringviewWTF16 ( ) ;
102
120
export const StringviewIter : HeapTypeRef = binaryen . _BinaryenHeapTypeStringviewIter ( ) ;
121
+ // bottom heap types
122
+ export const None : HeapTypeRef = 10 ; /* TODO_BinaryenHeapTypeNone */
123
+ export const Noextern : HeapTypeRef = 11 ; /* TODO_BinaryenHeapTypeNoext */
124
+ export const Nofunc : HeapTypeRef = 12 ; /* TODO_BinaryenHeapTypeNofunc */
103
125
}
104
126
105
127
/** Packed array element respectively struct field types. */
@@ -3699,7 +3721,7 @@ function tryEnsureBasicType(type: Type): TypeRef {
3699
3721
return binaryen . _BinaryenTypeFromHeapType ( HeapTypeRef . Func , type . is ( TypeFlags . NULLABLE ) ) ;
3700
3722
}
3701
3723
case TypeKind . EXTERNREF : {
3702
- return binaryen . _BinaryenTypeFromHeapType ( HeapTypeRef . Ext , type . is ( TypeFlags . NULLABLE ) ) ;
3724
+ return binaryen . _BinaryenTypeFromHeapType ( HeapTypeRef . Extern , type . is ( TypeFlags . NULLABLE ) ) ;
3703
3725
}
3704
3726
case TypeKind . ANYREF : {
3705
3727
return binaryen . _BinaryenTypeFromHeapType ( HeapTypeRef . Any , type . is ( TypeFlags . NULLABLE ) ) ;
0 commit comments