18 lines
650 B
JavaScript
18 lines
650 B
JavaScript
|
// 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");
|
||
|
|
||
|
var builder = new WasmModuleBuilder();
|
||
|
builder.addImportedTable("x", "table", 1, 10000000);
|
||
|
let module = new WebAssembly.Module(builder.toBuffer());
|
||
|
let table = new WebAssembly.Table({element: "anyfunc",
|
||
|
initial: 1, maximum:1000000});
|
||
|
let instance = new WebAssembly.Instance(module, {x: {table:table}});
|
||
|
|
||
|
assertThrows(() => table.grow(Infinity), RangeError);
|