e27deb72c7
The streaming compilation pipeline did not parse the names section and this is also not longer needed for getting function or local names. However, the module name still needs to be set eagerly. Change-Id: I1ac12e98b970ea0781302dc44ee684510bdf2d69 Reviewed-on: https://chromium-review.googlesource.com/962452 Reviewed-by: Andreas Haas <ahaas@chromium.org> Commit-Queue: Stephan Herhut <herhut@chromium.org> Cr-Commit-Position: refs/heads/master@{#51979}
24 lines
688 B
JavaScript
24 lines
688 B
JavaScript
// 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.
|
|
|
|
// Flags: --expose-wasm --no-stress-opt
|
|
|
|
load('test/mjsunit/mjsunit.js');
|
|
load('test/mjsunit/wasm/wasm-constants.js');
|
|
load('test/mjsunit/wasm/wasm-module-builder.js');
|
|
|
|
var builder = new WasmModuleBuilder();
|
|
builder.setName('test-module');
|
|
builder.addFunction(undefined, kSig_i_v)
|
|
.addBody([kExprUnreachable])
|
|
.exportAs('main');
|
|
let buffer = builder.toBuffer();
|
|
assertPromiseResult(WebAssembly.instantiate(buffer), pair => {
|
|
try {
|
|
pair.instance.exports.main();
|
|
} catch (e) {
|
|
print(e.stack);
|
|
}
|
|
});
|