// Copyright 2017 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: --expose-wasm --expose-gc --verify-heapload("test/mjsunit/wasm/user-properties-common.js");(functionExportedFunctionTest(){print("ExportedFunctionTest");print(" instance 1, exporting");varbuilder=newWasmModuleBuilder();builder.addFunction("exp",kSig_i_i).addBody([
kExprCallFunction,0]).exportAs("exp");letmodule1=builder.toModule();letinstance1=newWebAssembly.Instance(module1);letg=instance1.exports.exp;testProperties(g);// The WASM-internal fields of {g} are only inspected when {g} is// used as an import into another instance.print(" instance 2, importing");varbuilder=newWasmModuleBuilder();builder.addImport("imp","func",kSig_i_i);letmodule2=builder.toModule();letinstance2=newWebAssembly.Instance(module2,{imp:{func:g}});testProperties(g);})();