Bug 204054 - WebAssembly exception names
Summary: WebAssembly exception names
Status: RESOLVED DUPLICATE of bug 210980
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebAssembly (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-09 15:43 PST by Jan M
Modified: 2023-03-07 16:52 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan M 2019-11-09 15:43:55 PST
The WebAssembly exceptions (also thrown by the Wasm engine) have name properties
deviating from the other 3 major JS/Wasm engines.

Ideally a WebAssembly.CompileError should have name "CompileError", etc.
Consider:

 let e1 = new WebAssembly.CompileError("a compile error")
 let e2 = new WebAssembly.LinkError("a link error")
 let e3 = new WebAssembly.RuntimeError("a runtime error")
 print(e1.name, e1);
 print(e2.name, e2);
 print(e3.name, e3);

and compare the output across v8, spidermonkey, chakra, and javascriptcore:

$ v8 exceptions.js 
CompileError CompileError: a compile error
LinkError LinkError: a link error
RuntimeError RuntimeError: a runtime error

$ sm exceptions.js 
CompileError CompileError: a compile error
LinkError LinkError: a link error
RuntimeError RuntimeError: a runtime error

$ ch exceptions.js 
CompileError CompileError: a compile error
LinkError LinkError: a link error
RuntimeError RuntimeError: a runtime error

$ jsc exceptions.js 
Error Error: a compile error (evaluating 'new WebAssembly.CompileError("a compile error")')
Error Error: a link error (evaluating 'new WebAssembly.LinkError("a link error")')
Error Error: a runtime error (evaluating 'new WebAssembly.RuntimeError("a runtime error")')
Comment 1 Yusuke Suzuki 2023-03-07 16:52:56 PST

*** This bug has been marked as a duplicate of bug 210980 ***