From dc62a69775f7eff6a11e7ca7f162ae960b53e671 Mon Sep 17 00:00:00 2001 From: Oliver Buchtala Date: Tue, 24 Sep 2013 03:55:10 +0200 Subject: [PATCH] Fix bug with typedefd function pointers. --- Source/Modules/javascript.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/Modules/javascript.cxx b/Source/Modules/javascript.cxx index 05912a69e..8a77a0b48 100644 --- a/Source/Modules/javascript.cxx +++ b/Source/Modules/javascript.cxx @@ -664,7 +664,12 @@ int JSEmitter::emitWrapperFunction(Node *n) { String *kind = Getattr(n, "kind"); if (kind) { - if (Cmp(kind, "function") == 0) { + + if (Equal(kind, "function") + // HACK: sneaky.ctest revealed that typedef'd (global) functions must be + // detected via the 'view' attribute. + || (Equal(kind, "variable") && Equal(Getattr(n, "view"), "globalfunctionHandler")) + ) { bool is_member = GetFlag(n, "ismember") | GetFlag(n, "feature:extend"); bool is_static = GetFlag(state.function(), IS_STATIC); ret = emitFunction(n, is_member, is_static);