@@ -5264,6 +5264,130 @@ Module['Function'] = (() => {
52645264 return Function ;
52655265} ) ( ) ;
52665266
5267+ // Table wrapper
5268+ Module [ 'Table' ] = ( ( ) => {
5269+ /** @constructor */
5270+ function Table ( table ) {
5271+ if ( ! ( this instanceof Table ) ) {
5272+ if ( ! table ) return null ;
5273+ return new Table ( table ) ;
5274+ }
5275+ if ( ! table ) throw Error ( "table reference must not be null" ) ;
5276+ this [ thisPtr ] = table ;
5277+ }
5278+ /**
5279+ * Gets the name of the specified `Table`.
5280+ *
5281+ * @param {Table } table - The `Table` to get the name from.
5282+ *
5283+ * @return {string } The name of the `Table`.
5284+ */
5285+ Table [ 'getName' ] = function ( table ) {
5286+ return UTF8ToString ( Module [ '_BinaryenTableGetName' ] ( table ) ) ;
5287+ } ;
5288+
5289+ /**
5290+ * Sets the name of the specified `Table`.
5291+ *
5292+ * @param {Table } table - The `Table` to set the name for.
5293+ * @param {string } name - The new name for the `Table`.
5294+ *
5295+ * @return {void }
5296+ */
5297+ Table [ 'setName' ] = function ( table , name ) {
5298+ preserveStack ( ( ) => {
5299+ Module [ '_BinaryenTableSetName' ] ( table , strToStack ( name ) ) ;
5300+ } ) ;
5301+ } ;
5302+
5303+ /**
5304+ * Gets the initial number of pages of the specified `Table`.
5305+ *
5306+ * @param {Table } table - The `Table` to get the initial number of pages from.
5307+ *
5308+ * @return {number } The initial number of pages of the `Table`.
5309+ */
5310+ Table [ 'getInitial' ] = function ( table ) {
5311+ return Module [ '_BinaryenTableGetInitial' ] ( table ) ;
5312+ } ;
5313+
5314+ /**
5315+ * Sets the initial number of pages of the specified `Table`.
5316+ *
5317+ * @param {Table } table - The `Table` to set the initial number of pages for.
5318+ * @param {number } initial - The new initial number of pages for the `Table`.
5319+ *
5320+ * @return {void }
5321+ */
5322+ Table [ 'setInitial' ] = function ( table , initial ) {
5323+ Module [ '_BinaryenTableSetInitial' ] ( table , initial ) ;
5324+ } ;
5325+
5326+ /**
5327+ * Tests whether the specified `Table` has a maximum number of pages.
5328+ *
5329+ * @param {Table } table - The `Table` to test.
5330+ *
5331+ * @return {boolean } `true` if the `Table` has a maximum number of pages, `false` otherwise.
5332+ */
5333+ Table [ 'hasMax' ] = function ( table ) {
5334+ return Boolean ( Module [ '_BinaryenTableHasMax' ] ( table ) ) ;
5335+ } ;
5336+
5337+ /**
5338+ * Gets the maximum number of pages of the specified `Table`.
5339+ *
5340+ * @param {Table } table - The `Table` to get the maximum number of pages from.
5341+ *
5342+ * @return {number } The maximum number of pages of the `Table`.
5343+ */
5344+ Table [ 'getMax' ] = function ( table ) {
5345+ return Module [ '_BinaryenTableGetMax' ] ( table ) ;
5346+ } ;
5347+
5348+ /**
5349+ * Sets the maximum number of pages of the specified `Table`.
5350+ *
5351+ * @param {Table } table - The `Table` to set the maximum number of pages for.
5352+ * @param {number } max - The new maximum number of pages for the `Table`.
5353+ *
5354+ * @return {void }
5355+ */
5356+ Table [ 'setMax' ] = function ( table , max ) {
5357+ return Module [ '_BinaryenTableSetMax' ] ( table , max ) ;
5358+ } ;
5359+
5360+ /**
5361+ * Gets the table type of the specified `Table`.
5362+ *
5363+ * @param {Table } table - The `Table` to get the type from.
5364+ *
5365+ * @return {number } The type of the `Table`.
5366+ */
5367+ Table [ 'getType' ] = function ( table ) {
5368+ return Module [ '_BinaryenTableGetType' ] ( table ) ;
5369+ } ;
5370+
5371+ /**
5372+ * Sets the table type of the specified `Table`.
5373+ *
5374+ * @param {Table } table - The `Table` to set the type for.
5375+ * @param {Type } tableType - The new type for the `Table`.
5376+ *
5377+ * @return {void }
5378+ */
5379+ Table [ 'setType' ] = function ( table , tableType ) {
5380+ return Module [ '_BinaryenTableSetType' ] ( table , tableType ) ;
5381+ } ;
5382+
5383+ deriveWrapperInstanceMembers ( Table . prototype , Table ) ;
5384+ Table . prototype [ 'valueOf' ] = function ( ) {
5385+ return this [ thisPtr ] ;
5386+ } ;
5387+ return Table ;
5388+ } ) ( ) ;
5389+
5390+
52675391// Additional customizations
52685392
52695393Module [ 'exit' ] = function ( status ) {
0 commit comments