diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-01-23 01:28:09 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-23 01:28:09 +0800 |
commit | 5e2cd07d6f6866b1ddae51a4c9b280d2cd527973 (patch) | |
tree | 9ae8b16e7ec90ac1f3d189532a5162d6e28914a6 /lib/scope.js | |
parent | 06166df999f71a033d52e1a6213c36dd5bace2e8 (diff) | |
download | tracifyjs-5e2cd07d6f6866b1ddae51a4c9b280d2cd527973.tar.gz tracifyjs-5e2cd07d6f6866b1ddae51a4c9b280d2cd527973.zip |
handle duplicate function declarations correctly (#2837)
fixes #2836
Diffstat (limited to 'lib/scope.js')
-rw-r--r-- | lib/scope.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/scope.js b/lib/scope.js index af852bb1..6c883c66 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -305,7 +305,7 @@ AST_Scope.DEFMETHOD("find_variable", function(name){ AST_Scope.DEFMETHOD("def_function", function(symbol, init){ var def = this.def_variable(symbol, init); - if (!def.init) def.init = init; + if (!def.init || def.init instanceof AST_Defun) def.init = init; this.functions.set(symbol.name, def); return def; }); |