// Copyright 2018 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.load('test/mjsunit/wasm/wasm-module-builder.js');constexportingModuleBinary=(()=>{constbuilder=newWasmModuleBuilder();builder.addFunction('f',kSig_i_v).addBody([kExprI32Const,42]).exportFunc();returnbuilder.toBuffer();})();constexportingModule=newWebAssembly.Module(exportingModuleBinary);constexportingInstance=newWebAssembly.Instance(exportingModule);constreExportingModuleBinary=(()=>{constbuilder=newWasmModuleBuilder();constgIndex=builder.addImport('a','g',kSig_i_v);builder.addExport('y',gIndex);returnbuilder.toBuffer();})();constmodule=newWebAssembly.Module(reExportingModuleBinary);constimports={a:{g:exportingInstance.exports.f},};constinstance=newWebAssembly.Instance(module,imports);// Previously exported Wasm functions are re-exported with the same valueassertEquals(instance.exports.y,exportingInstance.exports.f);