@@ -202,13 +202,6 @@ export namespace TypeBuilderErrorReason {
202202  } 
203203} 
204204
205- /** Type system constants. */ 
206- export  type  TypeSystem  =  binaryen . TypeSystem ; 
207- export  namespace  TypeSystem  { 
208-   export  const  Isorecursive : TypeSystem  =  0  /* _BinaryenTypeSystemIsorecursive */ ; 
209-   export  const  Nominal : TypeSystem  =  1  /* _BinaryenTypeSystemNominal */ ; 
210- } 
211- 
212205/** Binaryen feature constants. */ 
213206export  const  enum  FeatureFlags  { 
214207  MVP  =  0  /* _BinaryenFeatureMVP */ , 
@@ -224,11 +217,11 @@ export const enum FeatureFlags {
224217  MultiValue  =  512  /* _BinaryenFeatureMultivalue */ , 
225218  GC  =  1024  /* _BinaryenFeatureGC */ , 
226219  Memory64  =  2048  /* _BinaryenFeatureMemory64 */ , 
227-   RelaxedSIMD  =  8192  /* _BinaryenFeatureRelaxedSIMD */ , 
228-   ExtendedConst  =  16384  /* _BinaryenFeatureExtendedConst */ , 
229-   Stringref  =  32768  /* _BinaryenFeatureStrings */ , 
230-   MultiMemory  =  65536  /* _BinaryenFeatureMultiMemories  */ , 
231-   All  =  126975  /* _BinaryenFeatureAll */ 
220+   RelaxedSIMD  =  4096  /* _BinaryenFeatureRelaxedSIMD */ , 
221+   ExtendedConst  =  8192  /* _BinaryenFeatureExtendedConst */ , 
222+   Stringref  =  16384  /* _BinaryenFeatureStrings */ , 
223+   MultiMemory  =  32768  /* _BinaryenFeatureMultiMemory  */ , 
224+   All  =  131071  /* _BinaryenFeatureAll */ 
232225} 
233226
234227/** Binaryen expression id constants. */ 
@@ -282,43 +275,44 @@ export const enum ExpressionId {
282275  TableSet  =  46  /* _BinaryenTableSetId */ , 
283276  TableSize  =  47  /* _BinaryenTableSizeId */ , 
284277  TableGrow  =  48  /* _BinaryenTableGrowId */ , 
285-   Try  =  49  /* _BinaryenTryId */ , 
286-   Throw  =  50  /* _BinaryenThrowId */ , 
287-   Rethrow  =  51  /* _BinaryenRethrowId */ , 
288-   TupleMake  =  52  /* _BinaryenTupleMakeId */ , 
289-   TupleExtract  =  53  /* _BinaryenTupleExtractId */ , 
290-   I31New  =  54  /* _BinaryenI31NewId  */ , 
291-   I31Get  =  55  /* _BinaryenI31GetId */ , 
292-   CallRef  =  56  /* _BinaryenCallRefId */ , 
293-   RefTest  =  57  /* _BinaryenRefTestId */ , 
294-   RefCast  =  58  /* _BinaryenRefCastId */ , 
295-   BrOn  =  59  /* _BinaryenBrOnId */ , 
296-   StructNew  =  60  /* _BinaryenStructNewId */ , 
297-   StructGet  =  61  /* _BinaryenStructGetId */ , 
298-   StructSet  =  62  /* _BinaryenStructSetId */ , 
299-   ArrayNew  =  63  /* _BinaryenArrayNewId */ , 
278+   Try  =  50  /* _BinaryenTryId */ , 
279+   Throw  =  51  /* _BinaryenThrowId */ , 
280+   Rethrow  =  52  /* _BinaryenRethrowId */ , 
281+   TupleMake  =  53  /* _BinaryenTupleMakeId */ , 
282+   TupleExtract  =  54  /* _BinaryenTupleExtractId */ , 
283+   RefI31  =  55  /* _BinaryenRefI31Id  */ , 
284+   I31Get  =  56  /* _BinaryenI31GetId */ , 
285+   CallRef  =  57  /* _BinaryenCallRefId */ , 
286+   RefTest  =  58  /* _BinaryenRefTestId */ , 
287+   RefCast  =  59  /* _BinaryenRefCastId */ , 
288+   BrOn  =  60  /* _BinaryenBrOnId */ , 
289+   StructNew  =  61  /* _BinaryenStructNewId */ , 
290+   StructGet  =  62  /* _BinaryenStructGetId */ , 
291+   StructSet  =  63  /* _BinaryenStructSetId */ , 
292+   ArrayNew  =  64  /* _BinaryenArrayNewId */ , 
300293  ArrayNewSeg  =  64  /* TODO_BinaryenArraySegId */ , 
301-   ArrayNewFixed  =  65  /* _BinaryenArrayNewFixedId */ , 
302-   ArrayGet  =  66  /* _BinaryenArrayGetId */ , 
303-   ArraySet  =  67  /* _BinaryenArraySetId */ , 
304-   ArrayLen  =  68  /* _BinaryenArrayLenId */ , 
305-   ArrayCopy  =  69  /* _BinaryenArrayCopyId */ , 
306-   ArrayFill  =  70  /* _BinaryenArrayFillId */ , 
307-   ArrayInit  =  71  /* _BinaryenArrayInitId */ , 
308-   RefAs  =  72  /* _BinaryenRefAsId */ , 
309-   StringNew  =  73  /* _BinaryenStringNewId */ , 
310-   StringConst  =  74  /* _BinaryenStringConstId */ , 
311-   StringMeasure  =  75  /* _BinaryenStringMeasureId */ , 
312-   StringEncode  =  76  /* _BinaryenStringEncodeId */ , 
313-   StringConcat  =  77  /* _BinaryenStringConcatId */ , 
314-   StringEq  =  78  /* _BinaryenStringEqId */ , 
315-   StringAs  =  79  /* _BinaryenStringAsId */ , 
316-   StringWTF8Advance  =  80  /* _BinaryenStringWTF8AdvanceId */ , 
317-   StringWTF16Get  =  81  /* _BinaryenStringWTF16GetId */ , 
318-   StringIterNext  =  82  /* _BinaryenStringIterNextId */ , 
319-   StringIterMove  =  83  /* _BinaryenStringIterMoveId */ , 
320-   StringSliceWTF  =  84  /* _BinaryenStringSliceWTFId */ , 
321-   StringSliceIter  =  85  /* _BinaryenStringSliceIterId */ 
294+   ArrayNewFixed  =  67  /* _BinaryenArrayNewFixedId */ , 
295+   ArrayGet  =  68  /* _BinaryenArrayGetId */ , 
296+   ArraySet  =  69  /* _BinaryenArraySetId */ , 
297+   ArrayLen  =  70  /* _BinaryenArrayLenId */ , 
298+   ArrayCopy  =  71  /* _BinaryenArrayCopyId */ , 
299+   ArrayFill  =  72  /* _BinaryenArrayFillId */ , 
300+   ArrayInitData  =  73  /* _BinaryenArrayInitDataId */ , 
301+   ArrayInitElem  =  74  /* _BinaryenArrayInitElemId */ , 
302+   RefAs  =  75  /* _BinaryenRefAsId */ , 
303+   StringNew  =  76  /* _BinaryenStringNewId */ , 
304+   StringConst  =  77  /* _BinaryenStringConstId */ , 
305+   StringMeasure  =  78  /* _BinaryenStringMeasureId */ , 
306+   StringEncode  =  79  /* _BinaryenStringEncodeId */ , 
307+   StringConcat  =  80  /* _BinaryenStringConcatId */ , 
308+   StringEq  =  81  /* _BinaryenStringEqId */ , 
309+   StringAs  =  82  /* _BinaryenStringAsId */ , 
310+   StringWTF8Advance  =  83  /* _BinaryenStringWTF8AdvanceId */ , 
311+   StringWTF16Get  =  84  /* _BinaryenStringWTF16GetId */ , 
312+   StringIterNext  =  85  /* _BinaryenStringIterNextId */ , 
313+   StringIterMove  =  86  /* _BinaryenStringIterMoveId */ , 
314+   StringSliceWTF  =  87  /* _BinaryenStringSliceWTFId */ , 
315+   StringSliceIter  =  88  /* _BinaryenStringSliceIterId */ 
322316} 
323317
324318/** Binaryen external kind constants. */ 
@@ -1272,15 +1266,15 @@ export const enum StringNewOp {
12721266  /** string.new_wtf8 wtf8 */ 
12731267  WTF8  =  1  /* _BinaryenStringNewWTF8 */ , 
12741268  /** string.new_wtf8 replace */ 
1275-   Replace  =  2  /* _BinaryenStringNewReplace  */ , 
1269+   LossyUTF8  =  2  /* _BinaryenStringNewLossyUTF8  */ , 
12761270  /** string.new_wtf16 */ 
12771271  WTF16  =  3  /* _BinaryenStringNewWTF16 */ , 
12781272  /** string.new_wtf8_array utf8 */ 
12791273  UTF8Array  =  4  /* _BinaryenStringNewUTF8Array */ , 
12801274  /** string.new_wtf8_array wtf8 */ 
12811275  WTF8Array  =  5  /* _BinaryenStringNewWTF8Array */ , 
12821276  /** string.new_wtf8_array replace */ 
1283-   ReplaceArray  =  6  /* _BinaryenStringNewReplaceArray  */ , 
1277+   LossyUTF8Array  =  6  /* _BinaryenStringNewLossyUTF8Array  */ , 
12841278  /** string.new_wtf16_array */ 
12851279  WTF16Array  =  7  /* _BinaryenStringNewWTF16Array */ , 
12861280  /** string.from_code_point */ 
@@ -1305,16 +1299,20 @@ export const enum StringMeasureOp {
13051299export  const  enum  StringEncodeOp  { 
13061300  /** string.encode_wtf8 utf8 */ 
13071301  UTF8  =  0  /* _BinaryenStringEncodeUTF8 */ , 
1302+   /** string.encode_lossy_utf8 utf8 */ 
1303+   LossyUTF8  =  1  /* _BinaryenStringEncodeLossyUTF8 */ , 
13081304  /** string.encode_wtf8 wtf8 */ 
1309-   WTF8  =  1  /* _BinaryenStringEncodeWTF8 */ , 
1305+   WTF8  =  2  /* _BinaryenStringEncodeWTF8 */ , 
13101306  /** string.encode_wtf16 */ 
1311-   WTF16  =  2  /* _BinaryenStringEncodeWTF16 */ , 
1307+   WTF16  =  3  /* _BinaryenStringEncodeWTF16 */ , 
13121308  /** string.encode_wtf8_array utf8 */ 
1313-   UTF8Array  =  3  /* _BinaryenStringEncodeUTF8Array */ , 
1309+   UTF8Array  =  4  /* _BinaryenStringEncodeUTF8Array */ , 
1310+   /** string.encode_lossy_utf8_array utf8 */ 
1311+   LossyUTF8Array  =  5  /* _BinaryenStringEncodeLossyUTF8Array */ , 
13141312  /** string.encode_wtf8_array wtf8 */ 
1315-   WTF8Array  =  4  /* _BinaryenStringEncodeWTF8Array */ , 
1313+   WTF8Array  =  6  /* _BinaryenStringEncodeWTF8Array */ , 
13161314  /** string.encode_wtf16_array */ 
1317-   WTF16Array  =  5  /* _BinaryenStringEncodeWTF16Array */ 
1315+   WTF16Array  =  7  /* _BinaryenStringEncodeWTF16Array */ 
13181316} 
13191317
13201318/** Binaryen StringEq operation constants. */ 
@@ -1378,7 +1376,6 @@ export class Module {
13781376  )  { 
13791377    assert ( sizeType  ==  TypeRef . I32  ||  sizeType  ==  TypeRef . I64 ) ; 
13801378    this . lit  =  binaryen . _malloc ( binaryen . _BinaryenSizeofLiteral ( ) ) ; 
1381-     binaryen . _BinaryenSetTypeSystem ( TypeSystem . Nominal ) ; 
13821379  } 
13831380
13841381  private  lit : usize ; 
@@ -2126,7 +2123,7 @@ export class Module {
21262123  i31_new ( 
21272124    value : ExpressionRef 
21282125  ) : ExpressionRef  { 
2129-     return  binaryen . _BinaryenI31New ( this . ref ,  value ) ; 
2126+     return  binaryen . _BinaryenRefI31 ( this . ref ,  value ) ; 
21302127  } 
21312128
21322129  i31_get ( 
@@ -2959,7 +2956,7 @@ export class Module {
29592956      case  ExpressionId . Const :
29602957      case  ExpressionId . RefNull :
29612958      case  ExpressionId . RefFunc :
2962-       case  ExpressionId . I31New : return  true ; 
2959+       case  ExpressionId . RefI31 : return  true ; 
29632960      case  ExpressionId . Binary : { 
29642961        if  ( this . getFeatures ( )  &  FeatureFlags . ExtendedConst )  { 
29652962          switch  ( getBinaryOp ( expr ) )  { 
@@ -3713,7 +3710,6 @@ export function ensureType(type: Type): TypeRef {
37133710    // @ts -ignore: Wasm only 
37143711    assert ( sizeof < usize > ( )  ==  4 ) ;  // ABI code below assumes 32-bit pointers 
37153712  } 
3716-   assert ( binaryen . _BinaryenGetTypeSystem ( )  ==  TypeSystem . Nominal ) ; 
37173713  let  builder  =  binaryen . _TypeBuilderCreate ( 0 ) ; 
37183714  let  seen  =  new  Map < Type , HeapTypeRef > ( ) ; 
37193715  prepareType ( builder ,  seen ,  type ) ;  // drop temp return 
0 commit comments