Commit 0af529a3 authored by Andreas Haas's avatar Andreas Haas Committed by V8 LUCI CQ

[wasm] Change type() for js-api objects

The type() function is now part of the js-api object and not part of the
constructor anymore, see
https://github.com/WebAssembly/js-types/blob/master/document/js-api/index.bs#L971

This fixes a failing spec test, but there is a bug in the test itself,
so it cannot be enabled yet.

R=thibaudm@chromium.org

Bug: v8:12227, v8:7742
Change-Id: I41e3752ad2e9af85c7197617f573dd0dc1a7a77f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3162036Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76849}
parent 0feba98a
...@@ -184,9 +184,6 @@ Local<String> v8_str(Isolate* isolate, const char* str) { ...@@ -184,9 +184,6 @@ Local<String> v8_str(Isolate* isolate, const char* str) {
} }
GET_FIRST_ARGUMENT_AS(Module) GET_FIRST_ARGUMENT_AS(Module)
GET_FIRST_ARGUMENT_AS(Memory)
GET_FIRST_ARGUMENT_AS(Table)
GET_FIRST_ARGUMENT_AS(Global)
GET_FIRST_ARGUMENT_AS(Tag) GET_FIRST_ARGUMENT_AS(Tag)
#undef GET_FIRST_ARGUMENT_AS #undef GET_FIRST_ARGUMENT_AS
...@@ -1917,16 +1914,14 @@ void WebAssemblyTableSet(const v8::FunctionCallbackInfo<v8::Value>& args) { ...@@ -1917,16 +1914,14 @@ void WebAssemblyTableSet(const v8::FunctionCallbackInfo<v8::Value>& args) {
i::WasmTableObject::Set(i_isolate, table_object, index, element); i::WasmTableObject::Set(i_isolate, table_object, index, element);
} }
// WebAssembly.Table.type(WebAssembly.Table) -> TableType // WebAssembly.Table.type() -> TableType
void WebAssemblyTableType(const v8::FunctionCallbackInfo<v8::Value>& args) { void WebAssemblyTableType(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::Isolate* isolate = args.GetIsolate(); v8::Isolate* isolate = args.GetIsolate();
HandleScope scope(isolate); HandleScope scope(isolate);
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Table.type()"); ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Table.type()");
auto maybe_table = GetFirstArgumentAsTable(args, &thrower); EXTRACT_THIS(table, WasmTableObject);
if (thrower.error()) return;
i::Handle<i::WasmTableObject> table = maybe_table.ToHandleChecked();
base::Optional<uint32_t> max_size; base::Optional<uint32_t> max_size;
if (!table->maximum_length().IsUndefined()) { if (!table->maximum_length().IsUndefined()) {
uint64_t max_size64 = table->maximum_length().Number(); uint64_t max_size64 = table->maximum_length().Number();
...@@ -1999,16 +1994,14 @@ void WebAssemblyMemoryGetBuffer( ...@@ -1999,16 +1994,14 @@ void WebAssemblyMemoryGetBuffer(
return_value.Set(Utils::ToLocal(buffer)); return_value.Set(Utils::ToLocal(buffer));
} }
// WebAssembly.Memory.type(WebAssembly.Memory) -> MemoryType // WebAssembly.Memory.type() -> MemoryType
void WebAssemblyMemoryType(const v8::FunctionCallbackInfo<v8::Value>& args) { void WebAssemblyMemoryType(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::Isolate* isolate = args.GetIsolate(); v8::Isolate* isolate = args.GetIsolate();
HandleScope scope(isolate); HandleScope scope(isolate);
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Memory.type()"); ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Memory.type()");
auto maybe_memory = GetFirstArgumentAsMemory(args, &thrower); EXTRACT_THIS(memory, WasmMemoryObject);
if (thrower.error()) return;
i::Handle<i::WasmMemoryObject> memory = maybe_memory.ToHandleChecked();
i::Handle<i::JSArrayBuffer> buffer(memory->array_buffer(), i_isolate); i::Handle<i::JSArrayBuffer> buffer(memory->array_buffer(), i_isolate);
size_t curr_size = buffer->byte_length() / i::wasm::kWasmPageSize; size_t curr_size = buffer->byte_length() / i::wasm::kWasmPageSize;
DCHECK_LE(curr_size, std::numeric_limits<uint32_t>::max()); DCHECK_LE(curr_size, std::numeric_limits<uint32_t>::max());
...@@ -2365,16 +2358,14 @@ void WebAssemblyGlobalSetValue( ...@@ -2365,16 +2358,14 @@ void WebAssemblyGlobalSetValue(
} }
} }
// WebAssembly.Global.type(WebAssembly.Global) -> GlobalType // WebAssembly.Global.type() -> GlobalType
void WebAssemblyGlobalType(const v8::FunctionCallbackInfo<v8::Value>& args) { void WebAssemblyGlobalType(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::Isolate* isolate = args.GetIsolate(); v8::Isolate* isolate = args.GetIsolate();
HandleScope scope(isolate); HandleScope scope(isolate);
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Global.type()"); ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Global.type()");
auto maybe_global = GetFirstArgumentAsGlobal(args, &thrower); EXTRACT_THIS(global, WasmGlobalObject);
if (thrower.error()) return;
i::Handle<i::WasmGlobalObject> global = maybe_global.ToHandleChecked();
auto type = i::wasm::GetTypeForGlobal(i_isolate, global->is_mutable(), auto type = i::wasm::GetTypeForGlobal(i_isolate, global->is_mutable(),
global->type()); global->type());
args.GetReturnValue().Set(Utils::ToLocal(type)); args.GetReturnValue().Set(Utils::ToLocal(type));
...@@ -2599,7 +2590,8 @@ void WasmJs::Install(Isolate* isolate, bool exposed_on_global_object) { ...@@ -2599,7 +2590,8 @@ void WasmJs::Install(Isolate* isolate, bool exposed_on_global_object) {
SideEffectType::kHasNoSideEffect); SideEffectType::kHasNoSideEffect);
InstallFunc(isolate, table_proto, "set", WebAssemblyTableSet, 2); InstallFunc(isolate, table_proto, "set", WebAssemblyTableSet, 2);
if (enabled_features.has_type_reflection()) { if (enabled_features.has_type_reflection()) {
InstallFunc(isolate, table_constructor, "type", WebAssemblyTableType, 1); InstallFunc(isolate, table_proto, "type", WebAssemblyTableType, 0, false,
NONE, SideEffectType::kHasNoSideEffect);
} }
JSObject::AddProperty(isolate, table_proto, factory->to_string_tag_symbol(), JSObject::AddProperty(isolate, table_proto, factory->to_string_tag_symbol(),
v8_str(isolate, "WebAssembly.Table"), ro_attributes); v8_str(isolate, "WebAssembly.Table"), ro_attributes);
...@@ -2619,7 +2611,8 @@ void WasmJs::Install(Isolate* isolate, bool exposed_on_global_object) { ...@@ -2619,7 +2611,8 @@ void WasmJs::Install(Isolate* isolate, bool exposed_on_global_object) {
InstallFunc(isolate, memory_proto, "grow", WebAssemblyMemoryGrow, 1); InstallFunc(isolate, memory_proto, "grow", WebAssemblyMemoryGrow, 1);
InstallGetter(isolate, memory_proto, "buffer", WebAssemblyMemoryGetBuffer); InstallGetter(isolate, memory_proto, "buffer", WebAssemblyMemoryGetBuffer);
if (enabled_features.has_type_reflection()) { if (enabled_features.has_type_reflection()) {
InstallFunc(isolate, memory_constructor, "type", WebAssemblyMemoryType, 1); InstallFunc(isolate, memory_proto, "type", WebAssemblyMemoryType, 0, false,
NONE, SideEffectType::kHasNoSideEffect);
} }
JSObject::AddProperty(isolate, memory_proto, factory->to_string_tag_symbol(), JSObject::AddProperty(isolate, memory_proto, factory->to_string_tag_symbol(),
v8_str(isolate, "WebAssembly.Memory"), ro_attributes); v8_str(isolate, "WebAssembly.Memory"), ro_attributes);
...@@ -2641,7 +2634,8 @@ void WasmJs::Install(Isolate* isolate, bool exposed_on_global_object) { ...@@ -2641,7 +2634,8 @@ void WasmJs::Install(Isolate* isolate, bool exposed_on_global_object) {
InstallGetterSetter(isolate, global_proto, "value", WebAssemblyGlobalGetValue, InstallGetterSetter(isolate, global_proto, "value", WebAssemblyGlobalGetValue,
WebAssemblyGlobalSetValue); WebAssemblyGlobalSetValue);
if (enabled_features.has_type_reflection()) { if (enabled_features.has_type_reflection()) {
InstallFunc(isolate, global_constructor, "type", WebAssemblyGlobalType, 1); InstallFunc(isolate, global_proto, "type", WebAssemblyGlobalType, 0, false,
NONE, SideEffectType::kHasNoSideEffect);
} }
JSObject::AddProperty(isolate, global_proto, factory->to_string_tag_symbol(), JSObject::AddProperty(isolate, global_proto, factory->to_string_tag_symbol(),
v8_str(isolate, "WebAssembly.Global"), ro_attributes); v8_str(isolate, "WebAssembly.Global"), ro_attributes);
......
...@@ -8,13 +8,13 @@ d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js'); ...@@ -8,13 +8,13 @@ d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js');
(function TestTableType() { (function TestTableType() {
let table = new WebAssembly.Table({initial: 1, element: "externref"}); let table = new WebAssembly.Table({initial: 1, element: "externref"});
let type = WebAssembly.Table.type(table); let type = table.type();
assertEquals(1, type.minimum); assertEquals(1, type.minimum);
assertEquals("externref", type.element); assertEquals("externref", type.element);
assertEquals(2, Object.getOwnPropertyNames(type).length); assertEquals(2, Object.getOwnPropertyNames(type).length);
table = new WebAssembly.Table({initial: 2, maximum: 15, element: "externref"}); table = new WebAssembly.Table({initial: 2, maximum: 15, element: "externref"});
type = WebAssembly.Table.type(table); type = table.type();
assertEquals(2, type.minimum); assertEquals(2, type.minimum);
assertEquals(15, type.maximum); assertEquals(15, type.maximum);
assertEquals("externref", type.element); assertEquals("externref", type.element);
...@@ -23,19 +23,19 @@ d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js'); ...@@ -23,19 +23,19 @@ d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js');
(function TestGlobalType() { (function TestGlobalType() {
let global = new WebAssembly.Global({value: "externref", mutable: true}); let global = new WebAssembly.Global({value: "externref", mutable: true});
let type = WebAssembly.Global.type(global); let type = global.type();
assertEquals("externref", type.value); assertEquals("externref", type.value);
assertEquals(true, type.mutable); assertEquals(true, type.mutable);
assertEquals(2, Object.getOwnPropertyNames(type).length); assertEquals(2, Object.getOwnPropertyNames(type).length);
global = new WebAssembly.Global({value: "externref"}); global = new WebAssembly.Global({value: "externref"});
type = WebAssembly.Global.type(global); type = global.type();
assertEquals("externref", type.value); assertEquals("externref", type.value);
assertEquals(false, type.mutable); assertEquals(false, type.mutable);
assertEquals(2, Object.getOwnPropertyNames(type).length); assertEquals(2, Object.getOwnPropertyNames(type).length);
global = new WebAssembly.Global({value: "anyfunc"}); global = new WebAssembly.Global({value: "anyfunc"});
type = WebAssembly.Global.type(global); type = global.type();
assertEquals("anyfunc", type.value); assertEquals("anyfunc", type.value);
assertEquals(false, type.mutable); assertEquals(false, type.mutable);
assertEquals(2, Object.getOwnPropertyNames(type).length); assertEquals(2, Object.getOwnPropertyNames(type).length);
......
...@@ -6,52 +6,14 @@ ...@@ -6,52 +6,14 @@
d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js'); d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js');
(function TestInvalidArgumentToType() {
["abc", 123, {}, _ => 0].forEach(function(invalidInput) {
assertThrows(
() => WebAssembly.Memory.type(invalidInput), TypeError,
"WebAssembly.Memory.type(): Argument 0 must be a WebAssembly.Memory");
assertThrows(
() => WebAssembly.Table.type(invalidInput), TypeError,
"WebAssembly.Table.type(): Argument 0 must be a WebAssembly.Table");
assertThrows(
() => WebAssembly.Global.type(invalidInput), TypeError,
"WebAssembly.Global.type(): Argument 0 must be a WebAssembly.Global");
assertThrows(
() => WebAssembly.Function.type(invalidInput), TypeError,
"WebAssembly.Function.type(): Argument 0 must be a WebAssembly.Function");
});
assertThrows(
() => WebAssembly.Memory.type(
new WebAssembly.Table({initial:1, element: "anyfunc"})),
TypeError,
"WebAssembly.Memory.type(): Argument 0 must be a WebAssembly.Memory");
assertThrows(
() => WebAssembly.Table.type(
new WebAssembly.Memory({initial:1})), TypeError,
"WebAssembly.Table.type(): Argument 0 must be a WebAssembly.Table");
assertThrows(
() => WebAssembly.Global.type(
new WebAssembly.Memory({initial:1})), TypeError,
"WebAssembly.Global.type(): Argument 0 must be a WebAssembly.Global");
assertThrows(
() => WebAssembly.Function.type(
new WebAssembly.Memory({initial:1})), TypeError,
"WebAssembly.Function.type(): Argument 0 must be a WebAssembly.Function");
})();
(function TestMemoryType() { (function TestMemoryType() {
let mem = new WebAssembly.Memory({initial: 1}); let mem = new WebAssembly.Memory({initial: 1});
let type = WebAssembly.Memory.type(mem); let type = mem.type();
assertEquals(1, type.minimum); assertEquals(1, type.minimum);
assertEquals(1, Object.getOwnPropertyNames(type).length); assertEquals(1, Object.getOwnPropertyNames(type).length);
mem = new WebAssembly.Memory({initial: 2, maximum: 15}); mem = new WebAssembly.Memory({initial: 2, maximum: 15});
type = WebAssembly.Memory.type(mem); type = mem.type();
assertEquals(2, type.minimum); assertEquals(2, type.minimum);
assertEquals(15, type.maximum); assertEquals(15, type.maximum);
assertEquals(2, Object.getOwnPropertyNames(type).length); assertEquals(2, Object.getOwnPropertyNames(type).length);
...@@ -105,14 +67,14 @@ d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js'); ...@@ -105,14 +67,14 @@ d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js');
(function TestTableType() { (function TestTableType() {
let table = new WebAssembly.Table({initial: 1, element: "anyfunc"}); let table = new WebAssembly.Table({initial: 1, element: "anyfunc"});
let type = WebAssembly.Table.type(table); let type = table.type();
assertEquals(1, type.minimum); assertEquals(1, type.minimum);
assertEquals("anyfunc", type.element); assertEquals("anyfunc", type.element);
assertEquals(undefined, type.maximum); assertEquals(undefined, type.maximum);
assertEquals(2, Object.getOwnPropertyNames(type).length); assertEquals(2, Object.getOwnPropertyNames(type).length);
table = new WebAssembly.Table({initial: 2, maximum: 15, element: "anyfunc"}); table = new WebAssembly.Table({initial: 2, maximum: 15, element: "anyfunc"});
type = WebAssembly.Table.type(table); type = table.type();
assertEquals(2, type.minimum); assertEquals(2, type.minimum);
assertEquals(15, type.maximum); assertEquals(15, type.maximum);
assertEquals("anyfunc", type.element); assertEquals("anyfunc", type.element);
...@@ -171,31 +133,31 @@ d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js'); ...@@ -171,31 +133,31 @@ d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js');
(function TestGlobalType() { (function TestGlobalType() {
let global = new WebAssembly.Global({value: "i32", mutable: true}); let global = new WebAssembly.Global({value: "i32", mutable: true});
let type = WebAssembly.Global.type(global); let type = global.type();
assertEquals("i32", type.value); assertEquals("i32", type.value);
assertEquals(true, type.mutable); assertEquals(true, type.mutable);
assertEquals(2, Object.getOwnPropertyNames(type).length); assertEquals(2, Object.getOwnPropertyNames(type).length);
global = new WebAssembly.Global({value: "i32"}); global = new WebAssembly.Global({value: "i32"});
type = WebAssembly.Global.type(global); type = global.type();
assertEquals("i32", type.value); assertEquals("i32", type.value);
assertEquals(false, type.mutable); assertEquals(false, type.mutable);
assertEquals(2, Object.getOwnPropertyNames(type).length); assertEquals(2, Object.getOwnPropertyNames(type).length);
global = new WebAssembly.Global({value: "i64"}); global = new WebAssembly.Global({value: "i64"});
type = WebAssembly.Global.type(global); type = global.type();
assertEquals("i64", type.value); assertEquals("i64", type.value);
assertEquals(false, type.mutable); assertEquals(false, type.mutable);
assertEquals(2, Object.getOwnPropertyNames(type).length); assertEquals(2, Object.getOwnPropertyNames(type).length);
global = new WebAssembly.Global({value: "f32"}); global = new WebAssembly.Global({value: "f32"});
type = WebAssembly.Global.type(global); type = global.type();
assertEquals("f32", type.value); assertEquals("f32", type.value);
assertEquals(false, type.mutable); assertEquals(false, type.mutable);
assertEquals(2, Object.getOwnPropertyNames(type).length); assertEquals(2, Object.getOwnPropertyNames(type).length);
global = new WebAssembly.Global({value: "f64"}); global = new WebAssembly.Global({value: "f64"});
type = WebAssembly.Global.type(global); type = global.type();
assertEquals("f64", type.value); assertEquals("f64", type.value);
assertEquals(false, type.mutable); assertEquals(false, type.mutable);
assertEquals(2, Object.getOwnPropertyNames(type).length); assertEquals(2, Object.getOwnPropertyNames(type).length);
...@@ -242,26 +204,26 @@ d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js'); ...@@ -242,26 +204,26 @@ d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js');
(function TestMemoryConstructorWithMinimum() { (function TestMemoryConstructorWithMinimum() {
let mem = new WebAssembly.Memory({minimum: 1}); let mem = new WebAssembly.Memory({minimum: 1});
assertTrue(mem instanceof WebAssembly.Memory); assertTrue(mem instanceof WebAssembly.Memory);
let type = WebAssembly.Memory.type(mem); let type = mem.type();
assertEquals(1, type.minimum); assertEquals(1, type.minimum);
assertEquals(1, Object.getOwnPropertyNames(type).length); assertEquals(1, Object.getOwnPropertyNames(type).length);
mem = new WebAssembly.Memory({minimum: 1, maximum: 5}); mem = new WebAssembly.Memory({minimum: 1, maximum: 5});
assertTrue(mem instanceof WebAssembly.Memory); assertTrue(mem instanceof WebAssembly.Memory);
type = WebAssembly.Memory.type(mem); type = mem.type();
assertEquals(1, type.minimum); assertEquals(1, type.minimum);
assertEquals(5, type.maximum); assertEquals(5, type.maximum);
assertEquals(2, Object.getOwnPropertyNames(type).length); assertEquals(2, Object.getOwnPropertyNames(type).length);
mem = new WebAssembly.Memory({minimum: 1, initial: 2}); mem = new WebAssembly.Memory({minimum: 1, initial: 2});
assertTrue(mem instanceof WebAssembly.Memory); assertTrue(mem instanceof WebAssembly.Memory);
type = WebAssembly.Memory.type(mem); type = mem.type();
assertEquals(2, type.minimum); assertEquals(2, type.minimum);
assertEquals(1, Object.getOwnPropertyNames(type).length); assertEquals(1, Object.getOwnPropertyNames(type).length);
mem = new WebAssembly.Memory({minimum: 1, initial: 2, maximum: 5}); mem = new WebAssembly.Memory({minimum: 1, initial: 2, maximum: 5});
assertTrue(mem instanceof WebAssembly.Memory); assertTrue(mem instanceof WebAssembly.Memory);
type = WebAssembly.Memory.type(mem); type = mem.type();
assertEquals(2, type.minimum); assertEquals(2, type.minimum);
assertEquals(5, type.maximum); assertEquals(5, type.maximum);
assertEquals(2, Object.getOwnPropertyNames(type).length); assertEquals(2, Object.getOwnPropertyNames(type).length);
...@@ -270,14 +232,14 @@ d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js'); ...@@ -270,14 +232,14 @@ d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js');
(function TestTableConstructorWithMinimum() { (function TestTableConstructorWithMinimum() {
let table = new WebAssembly.Table({minimum: 1, element: 'anyfunc'}); let table = new WebAssembly.Table({minimum: 1, element: 'anyfunc'});
assertTrue(table instanceof WebAssembly.Table); assertTrue(table instanceof WebAssembly.Table);
let type = WebAssembly.Table.type(table); let type = table.type();
assertEquals(1, type.minimum); assertEquals(1, type.minimum);
assertEquals('anyfunc', type.element); assertEquals('anyfunc', type.element);
assertEquals(2, Object.getOwnPropertyNames(type).length); assertEquals(2, Object.getOwnPropertyNames(type).length);
table = new WebAssembly.Table({minimum: 1, element: 'anyfunc', maximum: 5}); table = new WebAssembly.Table({minimum: 1, element: 'anyfunc', maximum: 5});
assertTrue(table instanceof WebAssembly.Table); assertTrue(table instanceof WebAssembly.Table);
type = WebAssembly.Table.type(table); type = table.type();
assertEquals(1, type.minimum); assertEquals(1, type.minimum);
assertEquals(5, type.maximum); assertEquals(5, type.maximum);
assertEquals('anyfunc', type.element); assertEquals('anyfunc', type.element);
...@@ -285,7 +247,7 @@ d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js'); ...@@ -285,7 +247,7 @@ d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js');
table = new WebAssembly.Table({minimum: 1, initial: 2, element: 'anyfunc'}); table = new WebAssembly.Table({minimum: 1, initial: 2, element: 'anyfunc'});
assertTrue(table instanceof WebAssembly.Table); assertTrue(table instanceof WebAssembly.Table);
type = WebAssembly.Table.type(table); type = table.type();
assertEquals(2, type.minimum); assertEquals(2, type.minimum);
assertEquals('anyfunc', type.element); assertEquals('anyfunc', type.element);
assertEquals(2, Object.getOwnPropertyNames(type).length); assertEquals(2, Object.getOwnPropertyNames(type).length);
...@@ -293,7 +255,7 @@ d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js'); ...@@ -293,7 +255,7 @@ d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js');
table = new WebAssembly.Table({minimum: 1, initial: 2, element: 'anyfunc', table = new WebAssembly.Table({minimum: 1, initial: 2, element: 'anyfunc',
maximum: 5}); maximum: 5});
assertTrue(table instanceof WebAssembly.Table); assertTrue(table instanceof WebAssembly.Table);
type = WebAssembly.Table.type(table); type = table.type();
assertEquals(2, type.minimum); assertEquals(2, type.minimum);
assertEquals(5, type.maximum); assertEquals(5, type.maximum);
assertEquals('anyfunc', type.element); assertEquals('anyfunc', type.element);
......
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