From 4832bc5d88e37ca35f1dd5f5d8ddd95cd8bbdd7d Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Tue, 26 Dec 2017 21:25:35 +0800 Subject: replace single-use recursive functions (#2659) fixes #2628 --- lib/scope.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/scope.js') diff --git a/lib/scope.js b/lib/scope.js index bbfa037c..bceec289 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -307,7 +307,9 @@ AST_Scope.DEFMETHOD("find_variable", function(name){ }); AST_Scope.DEFMETHOD("def_function", function(symbol){ - this.functions.set(symbol.name, this.def_variable(symbol)); + var def = this.def_variable(symbol); + this.functions.set(symbol.name, def); + return def; }); AST_Scope.DEFMETHOD("def_variable", function(symbol){ -- cgit v1.2.3