diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-11-12 08:19:10 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-11-12 08:19:10 -0800 |
commit | 93b48cd720995297f9ec27a8af0d5cbb065f4a9a (patch) | |
tree | 3b7b1aa671264e8d09c6430a4a8b390509acca7c | |
parent | 5137ee95da159d327dc2f086894cd7feb7ca1b4b (diff) |
demangle new and delete
-rw-r--r-- | src/preamble.js | 4 | ||||
-rw-r--r-- | tests/test_other.py | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/preamble.js b/src/preamble.js index 3e76e503..deabd29a 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -646,6 +646,10 @@ function demangle(func) { if (func[0] !== '_') return func; if (func[1] !== '_') return func; // C function if (func[2] !== 'Z') return func; + switch (func[3]) { + case 'n': return 'operator new()'; + case 'd': return 'operator delete()'; + } var i = 3; // params, etc. var basicTypes = { diff --git a/tests/test_other.py b/tests/test_other.py index 584f6714..c79d9e5f 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -1944,7 +1944,8 @@ done. Popen([PYTHON, EMCC, 'src.cpp', '-s', 'LINKABLE=1']).communicate() output = run_js('a.out.js') - self.assertContained('''main + self.assertContained('''operator new() +_main f2() abcdabcdabcd(int) test(char, short, int, float, double, void*, int*, char*) |