// 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-wasmload("test/mjsunit/wasm/wasm-module-builder.js");letbinary=newBinary;binary.emit_header();binary.emit_section(kTypeSectionCode,section=>{section.emit_u32v(1);// number of typessection.emit_u8(kWasmFunctionTypeForm);section.emit_u32v(0);// number of parameterssection.emit_u32v(0);// number of returns});binary.emit_section(kFunctionSectionCode,section=>{section.emit_u32v(1);// number of functionssection.emit_u32v(0);// type index});binary.emit_u8(kCodeSectionCode);binary.emit_u8(0x02);// section lengthbinary.emit_u8(0x01);// number of functionsbinary.emit_u8(0x40);// function body size// Function body is missing here.letbuffer=newArrayBuffer(binary.length);letview=newUint8Array(buffer);for(leti=0;i<binary.length;i++){view[i]=binary[i]|0;}WebAssembly.validate(buffer);