diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-12-26 21:25:35 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-26 21:25:35 +0800 |
commit | 4832bc5d88e37ca35f1dd5f5d8ddd95cd8bbdd7d (patch) | |
tree | 925053e75bf5109861b7fdb54e30f0e5ae4b960f /lib/scope.js | |
parent | 7f342cb3e3abd3e39b18e62a2e9d6b8020d82773 (diff) | |
download | tracifyjs-4832bc5d88e37ca35f1dd5f5d8ddd95cd8bbdd7d.tar.gz tracifyjs-4832bc5d88e37ca35f1dd5f5d8ddd95cd8bbdd7d.zip |
replace single-use recursive functions (#2659)
fixes #2628
Diffstat (limited to 'lib/scope.js')
-rw-r--r-- | lib/scope.js | 4 |
1 files changed, 3 insertions, 1 deletions
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){ |