diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index 5367628..4e93630 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -134,6 +134,7 @@ class MethodNode(AstNode):
             anonfuncs = data.getVar('__BBANONFUNCS') or []
             anonfuncs.append(funcname)
             data.setVar('__BBANONFUNCS', anonfuncs)
+            data.setVar(funcname, text)
         else:
             data.setVarFlag(self.func_name, "func", 1)
             data.setVar(self.func_name, text)
