Commit 895748e6 authored by Emanuel Ziegler's avatar Emanuel Ziegler Committed by Commit Bot

[wasm] Correcting error message method name for new WebAssembly.Table

When calling new WebAssembly.Table, the returned error message refers
accidentally to the WebAssembly.Module() constructor.

There will be a corresponding Chromium CL fixing expected error messages
in WPTs.

R=ahaas@chromium.org

Bug: v8:11356
Change-Id: I57f5e071d5c542615523345283d7c3613fb7a616
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2663155Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Emanuel Ziegler <ecmziegler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72998}
parent 96a0677a
...@@ -1063,7 +1063,7 @@ void WebAssemblyTable(const v8::FunctionCallbackInfo<v8::Value>& args) { ...@@ -1063,7 +1063,7 @@ void WebAssemblyTable(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::Isolate* isolate = args.GetIsolate(); v8::Isolate* isolate = args.GetIsolate();
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
HandleScope scope(isolate); HandleScope scope(isolate);
ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Module()"); ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Table()");
if (!args.IsConstructCall()) { if (!args.IsConstructCall()) {
thrower.TypeError("WebAssembly.Table must be invoked with 'new'"); thrower.TypeError("WebAssembly.Table must be invoked with 'new'");
return; return;
......
...@@ -580,7 +580,7 @@ assertTrue(isConstructor(Table)); ...@@ -580,7 +580,7 @@ assertTrue(isConstructor(Table));
assertThrows( assertThrows(
() => Table(), TypeError, /must be invoked with 'new'/); () => Table(), TypeError, /must be invoked with 'new'/);
assertThrows( assertThrows(
() => new Table(1), TypeError, 'WebAssembly.Module(): Argument 0 must be a table descriptor'); () => new Table(1), TypeError, 'WebAssembly.Table(): Argument 0 must be a table descriptor');
assertThrows( assertThrows(
() => new Table({initial: 1, element: 1}), TypeError, /must be a WebAssembly reference type/); () => new Table({initial: 1, element: 1}), TypeError, /must be a WebAssembly reference type/);
assertThrows( assertThrows(
......
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