diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-04-17 11:14:58 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-04-17 11:14:58 -0700 |
commit | 99da1340487738c286fbc38f55dbc23aa9c3233a (patch) | |
tree | b708a63b5cd874cea2a069fa8444c92e94f9cf4d | |
parent | ed40b36281285c39011240c16459d12c7acec9f7 (diff) |
fix closure issues with exception handling, and add test coverage
-rw-r--r-- | src/library.js | 4 | ||||
-rw-r--r-- | src/shell.js | 4 | ||||
-rwxr-xr-x | tests/runner.py | 5 |
3 files changed, 11 insertions, 2 deletions
diff --git a/src/library.js b/src/library.js index 3dbf738d..c491f078 100644 --- a/src/library.js +++ b/src/library.js @@ -4587,12 +4587,12 @@ LibraryManager.library = { // return the type of the catch block which should be called. for (var i = 0; i < typeArray.length; i++) { if (___cxa_does_inherit(typeArray[i], throwntype, thrown)) - return { 'f0':thrown, 'f1':typeArray[i]}; + return { f0:thrown, f1:typeArray[i] }; } // Shouldn't happen unless we have bogus data in typeArray // or encounter a type for which emscripten doesn't have suitable // typeinfo defined. Best-efforts match just in case. - return {'f0':thrown,'f1':throwntype}; + return { f0:thrown, f1 :throwntype }; }, // Recursively walks up the base types of 'possibilityType' diff --git a/src/shell.js b/src/shell.js index ab54c284..e48be3b0 100644 --- a/src/shell.js +++ b/src/shell.js @@ -115,6 +115,10 @@ if (!Module['arguments']) { } // *** Environment setup code *** +// Closure helpers +Module.print = Module['print']; +Module.printErr = Module['printErr']; + {{BODY}} // {{MODULE_ADDITIONS}} diff --git a/tests/runner.py b/tests/runner.py index a6e65d20..30078a9e 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -1630,6 +1630,9 @@ m_divisor is 1091269979 if self.emcc_args is None: if Building.LLVM_OPTS: return self.skip('optimizing bitcode before emcc can confuse libcxx inclusion') self.emcc_args = [] # libc++ auto-inclusion is only done if we use emcc + else: + if '-O2' in self.emcc_args: + self.emcc_args += ['--closure', '1'] # Use closure here for some additional coverage src = ''' #include <stdio.h> @@ -1710,6 +1713,8 @@ m_divisor is 1091269979 def test_uncaught_exception(self): if self.emcc_args is None: return self.skip('no libcxx inclusion without emcc') + if '-O2' in self.emcc_args: + self.emcc_args += ['--closure', '1'] # Use closure here for some additional coverage Settings.EXCEPTION_DEBUG = 0 # Messes up expected output. Settings.DISABLE_EXCEPTION_CATCHING = 0 |