Skip to content

Commit 397f52e

Browse files
committed
Fix lifted call.
- we really need to document these
1 parent 00d8286 commit 397f52e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/callcc/declVars.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ const func = {
5656
exit(path: NodePath<t.FunctionDeclaration|t.FunctionExpression>) {
5757
const toDecl: t.Identifier[] | undefined = (<any>path.node).toDecl
5858
if(toDecl && toDecl.length > 0) {
59-
path.node.body.body.unshift(t.variableDeclaration('var',
60-
lifted(toDecl.map(d => t.variableDeclarator(d)))))
59+
path.node.body.body.unshift(lifted(t.variableDeclaration('var',
60+
toDecl.map(d => t.variableDeclarator(d)))))
6161
}
6262
}
6363
}
@@ -69,8 +69,8 @@ const prog = {
6969
exit(path: NodePath<t.Program>) {
7070
const toDecl: t.Identifier[] | undefined = (<any>path.node).toDecl
7171
if(toDecl && toDecl.length > 0) {
72-
path.node.body.unshift(t.variableDeclaration('var',
73-
lifted(toDecl.map(d => t.variableDeclarator(d)))))
72+
path.node.body.unshift(lifted(t.variableDeclaration('var',
73+
toDecl.map(d => t.variableDeclarator(d)))))
7474
}
7575
}
7676
}
@@ -113,10 +113,10 @@ const lift: Visitor = {
113113
// Therefore, we do not need to lift x. Instead, we eliminate the
114114
// declaration and only turn it into an assignment.
115115
if ((kind === 'var' && topArgs.includes(id)) === false) {
116-
(<any>topScope.node).toDecl.push(decl.id)
117116
//const newDecl = t.variableDeclaration(kind,
118117
//[t.variableDeclarator(decl.id)]);
119118
//getBlock(topScope.node).unshift(lifted(newDecl));
119+
(<any>topScope.node).toDecl.push(decl.id)
120120
}
121121
if (decl.init !== null) {
122122
// If we call path.insertAfter here, we will add assignments in reverse

0 commit comments

Comments
 (0)