on master help sign in
Also fixed issue where require-ing filenames with periods would end up unintentally having property access syntax
commit810b5dc0e8723d46aa83ab4cb93f28a4d319fa72 authorRisto Stevcev <risto1@gmail.com> dateSat 8 Jul 2017, 14:29 (9 years ago) parent2fdf342
1 file changed+2−4
src/IRTS/JavaScript/Codegen.hs+2−4
src/IRTS/JavaScript/Codegen.hs+2−4
@@ -83,12 +83,10 @@ includeLibs =
8383 let
8484 repl '\\' = '_'
8585 repl '/' = '_'
86+ repl '.' = '_'
8687 repl c = c
87−
88− trimPeriod ('.' : xs) = '_' : xs
89− trimPeriod s = s
9088 in
91− concatMap (\lib -> "var " ++ (trimPeriod $ repl <$> lib) ++ " = require(\"" ++ lib ++"\");\n")
89+ concatMap (\lib -> "var " ++ (repl <$> lib) ++ " = require(\"" ++ lib ++"\");\n")
9290
9391isYes :: Maybe String -> Bool
9492isYes (Just "Y") = True