Skip to content

Commit 53aff41

Browse files
authored
Add check for not supported webassembly.exception.stack (#18828)
1 parent d96d0c2 commit 53aff41

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/library_exceptions.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,10 +420,12 @@ var LibraryExceptions = {
420420
// ...
421421
//
422422
// Remove this JS function name, which is in the second line, from the stack
423-
// trace.
424-
var arr = e.stack.split('\n');
425-
arr.splice(1,1);
426-
e.stack = arr.join('\n');
423+
// trace. Note that .stack does not yet exist in all browsers (see #18828).
424+
if (e.stack) {
425+
var arr = e.stack.split('\n');
426+
arr.splice(1,1);
427+
e.stack = arr.join('\n');
428+
}
427429
throw e;
428430
},
429431
#endif

0 commit comments

Comments
 (0)