Skip to content

Commit 12b814a

Browse files
authored
[EH] Don't write to readonly Exception.stack property (#21065)
Apparently `WebAssembly.Exception.stack` has been `readonly` all along and I wasn't aware. While I'm not sure if this should be `readonly` and this may change in the future, for now writing to this property is not spec compliant, so this removes the routine that tidies up the stack trace, which is not the end of the world. Fixes #21044.
1 parent 1df0255 commit 12b814a

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

src/library_exceptions.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -327,20 +327,6 @@ var LibraryExceptions = {
327327
__throw_exception_with_stack_trace: (ex) => {
328328
var e = new WebAssembly.Exception(getCppExceptionTag(), [ex], {traceStack: true});
329329
e.message = getExceptionMessage(e);
330-
// The generated stack trace will be in the form of:
331-
//
332-
// Error
333-
// at ___throw_exception_with_stack_trace(test.js:1139:13)
334-
// at __cxa_throw (wasm://wasm/009a7c9a:wasm-function[1551]:0x24367)
335-
// ...
336-
//
337-
// Remove this JS function name, which is in the second line, from the stack
338-
// trace. Note that .stack does not yet exist in all browsers (see #18828).
339-
if (e.stack) {
340-
var arr = e.stack.split('\n');
341-
arr.splice(1,1);
342-
e.stack = arr.join('\n');
343-
}
344330
throw e;
345331
},
346332
#endif

0 commit comments

Comments
 (0)