on master help sign in
changed let and const to var
commit0e01ff0cd55e3cb2ab6174c2fd450ba51bf61ad7 authorRui Barreiro <rui.barreiro@gmail.com> dateWed 17 May 2017, 07:44 (9 years ago) parent8579263
1 file changed+2−4
src/IRTS/JavaScript/AST.hs+2−4
src/IRTS/JavaScript/AST.hs+2−4
@@ -138,14 +138,12 @@ jsAst2Text (JsVar x) = x
138138jsAst2Text (JsSeq JsEmpty y) = jsAst2Text y
139139jsAst2Text (JsSeq x JsEmpty) = jsAst2Text x
140140jsAst2Text (JsSeq x y) = T.concat [jsAst2Text x, ";\n", jsAst2Text y]
141−jsAst2Text (JsConst name exp) = T.concat [ "const ", name, " = ", jsAst2Text exp]
142−jsAst2Text (JsLet name exp) = T.concat [ "let ", name, " = ", jsAst2Text exp]
143−--jsAst2Text (JsLetList lst) = T.concat [ "let ", T.intercalate ", " (map (\(n,v) -> T.concat [n, " = ", jsAst2Text v] ) lst) ]
141+jsAst2Text (JsConst name exp) = T.concat [ "var ", name, " = ", jsAst2Text exp] -- using var instead of const until ES6
142+jsAst2Text (JsLet name exp) = T.concat [ "var ", name, " = ", jsAst2Text exp] -- using var instead of const until ES6
144143jsAst2Text (JsSetVar name exp) = T.concat [ name, " = ", jsAst2Text exp]
145144jsAst2Text (JsArrayProj i exp) = T.concat [ jsAst2Text exp, "[", jsAst2Text i, "]"]
146145jsAst2Text (JsInt i) = T.pack $ show i ++ "|0"
147146jsAst2Text (JsNum d) = T.pack $ show d
148−--jsAst2Text (JsInteger i) = T.pack $ show i
149147jsAst2Text (JsStr s) = "\"" `T.append` T.pack (concatMap translateChar s) `T.append` "\""
150148jsAst2Text (JsArray l) = T.concat [ "[", T.intercalate ", " (map jsAst2Text l), "]"]
151149jsAst2Text (JsSwitchCase exp l d) =