dead code elimination for JS backend; JS improvements (but doesn't work yet)

This commit is contained in:
Araq 2012-06-30 12:29:56 +02:00
commit ee1bcb6414
7 changed files with 213 additions and 104 deletions

View file

@ -510,6 +510,6 @@ proc liftLambdas(fn: PSym, body: PNode): PNode =
proc liftLambdas*(n: PNode): PNode =
assert n.kind in procDefs
if gCmd == cmdCompileToEcmaScript: return n
var s = n.sons[namePos].sym
if gCmd == cmdCompileToEcmaScript: return s.getBody
result = liftLambdas(s, s.getBody)