Commit a2081b2d authored by ahaas's avatar ahaas Committed by Commit bot

[wasm] The exports property of a wasm instance should always exist

R=clemensh@chromium.org
BUG=chromium:663994

Review-Url: https://codereview.chromium.org/2622563002
Cr-Commit-Position: refs/heads/master@{#42163}
parent 0df234b0
...@@ -1764,7 +1764,7 @@ class WasmInstanceBuilder { ...@@ -1764,7 +1764,7 @@ class WasmInstanceBuilder {
} }
Handle<JSObject> exports_object = instance; Handle<JSObject> exports_object = instance;
if (module_->export_table.size() > 0 && module_->origin == kWasmOrigin) { if (module_->origin == kWasmOrigin) {
// Create the "exports" object. // Create the "exports" object.
Handle<JSFunction> object_function = Handle<JSFunction>( Handle<JSFunction> object_function = Handle<JSFunction>(
isolate_->native_context()->object_function(), isolate_); isolate_->native_context()->object_function(), isolate_);
......
// 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
load("test/mjsunit/wasm/wasm-constants.js");
load("test/mjsunit/wasm/wasm-module-builder.js");
(function() {
var builder = new WasmModuleBuilder();
var module = builder.instantiate();
assertTrue(typeof(module.exports) != "undefined");
})();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment