forked from emscripten-core/emscripten
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibrary_exceptions_stub.js
33 lines (30 loc) · 1.25 KB
/
library_exceptions_stub.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
* @license
* Copyright 2019 The Emscripten Authors
* SPDX-License-Identifier: MIT
*/
var LibraryExceptions = {};
[
'__cxa_allocate_exception',
'__cxa_free_exception',
'__cxa_increment_exception_refcount',
'__cxa_decrement_exception_refcount',
'__cxa_throw',
'__cxa_rethrow',
'llvm_eh_typeid_for',
'__cxa_begin_catch',
'__cxa_end_catch',
'__cxa_get_exception_ptr',
'_ZSt18uncaught_exceptionv',
'__cxa_call_unexpected',
'__cxa_current_primary_exception',
'__cxa_rethrow_primary_exception',
'__cxa_find_matching_catch',
'__resumeException',
].forEach(function(name) {
LibraryExceptions[name] = function() { abort(); };
LibraryExceptions[name + '__deps'] = [function() {
error('DISABLE_EXCEPTION_THROWING was set (likely due to -fno-exceptions), which means no C++ exception throwing support code is linked in, but such support is required by symbol ' + name + '. Either do not set DISABLE_EXCEPTION_THROWING (if you do want exception throwing) or compile all source files with -fno-except (so that no exceptions support code is required); also make sure DISABLE_EXCEPTION_CATCHING is set to the right value - if you want exceptions, it should be off, and vice versa.');
}];
});
mergeInto(LibraryManager.library, LibraryExceptions);