// Copyright 2020 the V8 project authors. All rights reserved.// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.// Flags: --experimental-wasm-typed-funcrefload('test/mjsunit/wasm/wasm-module-builder.js');// Export an arbitrary function from a Wasm module (identity).letfoo=(()=>{letbuilder=newWasmModuleBuilder();builder.addFunction('foo',kSig_i_i).addBody([kExprLocalGet,0]).exportAs('foo');letmodule=newWebAssembly.Module(builder.toBuffer());return(newWebAssembly.Instance(builder.toModule())).exports.foo;})();(functionTableGrowWithInitializer(){print(arguments.callee.name);vartable=newWebAssembly.Table({element:'anyfunc',initial:0,maximum:100});table.grow(10);table.grow(10,foo);table.grow(10,null);table.grow(10,undefined);for(leti=0;i<10;i++){assertNull(table.get(i));}for(leti=10;i<20;i++){assertEquals(foo,table.get(i));}for(leti=20;i<40;i++){assertNull(table.get(i));}})();