New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 786021 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

WebAssembly Module and Instance calls should throw if new target is undefined

Project Member Reported by jfb@chromium.org, Nov 16 2017

Issue description

According to the WebAssembly design:

  https://github.com/WebAssembly/design/blob/master/JS.md#webassemblymodule-constructor

This should throw a TypeError:

  WebAssembly.Module(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x1, 0x00, 0x00, 0x00));

This should not:

  new WebAssembly.Module(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x1, 0x00, 0x00, 0x00));

In V8, neither does. SpiderMonkey and JavaScriptCore exhibit the spec behavior.

Ditto for Instance, Memory, Table. Only the errors don't require that behavior because of JavaScript legacy where errors don't require new (except, amusingly, some DOM errors which have been flip-flopping about requiring new or not).
 
Cc: titzer@chromium.org
Owner: bradnelson@chromium.org
Status: Assigned (was: Unconfirmed)
Status: Started (was: Assigned)
Status: Fixed (was: Started)

Sign in to add a comment