aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/preamble.js4
-rw-r--r--tests/test_other.py3
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*)