| 662 | } |
| 663 | |
| 664 | function makeThrow() { |
| 665 | if (DISABLE_EXCEPTION_CATCHING) { |
| 666 | if (ASSERTIONS) { |
| 667 | var assertInfo = |
| 668 | 'Exception thrown, but exception catching is not enabled. Compile with -sNO_DISABLE_EXCEPTION_CATCHING or -sEXCEPTION_CATCHING_ALLOWED=[..] to catch.'; |
| 669 | if (MAIN_MODULE) { |
| 670 | assertInfo += |
| 671 | ' (note: in dynamic linking, if a side module wants exceptions, the main module must be built with that support)'; |
| 672 | } |
| 673 | return `assert(false, '${assertInfo}');`; |
| 674 | } else { |
| 675 | return 'abort()'; |
| 676 | } |
| 677 | } |
| 678 | return 'throw exceptionLast;'; |
| 679 | } |
| 680 | |
| 681 | function charCode(char) { |
| 682 | return char.charCodeAt(0); |