@@ -981,7 +981,7 @@ class WasmModuleBuilder {
981
981
section . emit_u32v ( imp . initial ) ; // initial
982
982
if ( has_max ) section . emit_u32v ( imp . maximum ) ; // maximum
983
983
} else if ( imp . kind == kExternalTable ) {
984
- section . emit_u8 ( imp . type ) ;
984
+ section . emit_type ( imp . type ) ;
985
985
var has_max = ( typeof imp . maximum ) != "undefined" ;
986
986
section . emit_u8 ( has_max ? 1 : 0 ) ; // flags
987
987
section . emit_u32v ( imp . initial ) ; // initial
@@ -1013,7 +1013,7 @@ class WasmModuleBuilder {
1013
1013
binary . emit_section ( kTableSectionCode , section => {
1014
1014
section . emit_u32v ( wasm . tables . length ) ;
1015
1015
for ( let table of wasm . tables ) {
1016
- section . emit_u8 ( table . type ) ;
1016
+ section . emit_type ( table . type ) ;
1017
1017
section . emit_u8 ( table . has_max ) ;
1018
1018
section . emit_u32v ( table . initial_size ) ;
1019
1019
if ( table . has_max ) section . emit_u32v ( table . max_size ) ;
@@ -1045,7 +1045,7 @@ class WasmModuleBuilder {
1045
1045
binary . emit_section ( kGlobalSectionCode , section => {
1046
1046
section . emit_u32v ( wasm . globals . length ) ;
1047
1047
for ( let global of wasm . globals ) {
1048
- section . emit_u8 ( global . type ) ;
1048
+ section . emit_type ( global . type ) ;
1049
1049
section . emit_u8 ( global . mutable ) ;
1050
1050
if ( ( typeof global . init_index ) == "undefined" ) {
1051
1051
// Emit a constant initializer.
@@ -1219,7 +1219,7 @@ class WasmModuleBuilder {
1219
1219
header . emit_u32v ( local_decls . length ) ;
1220
1220
for ( let decl of local_decls ) {
1221
1221
header . emit_u32v ( decl . count ) ;
1222
- header . emit_u8 ( decl . type ) ;
1222
+ header . emit_type ( decl . type ) ;
1223
1223
}
1224
1224
1225
1225
section . emit_u32v ( header . length + func . body . length ) ;
0 commit comments