Skip to content

Commit e8e4cf9

Browse files
committed
Remove/Clean up some dead code
1 parent 3ae8828 commit e8e4cf9

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

compiler/src/Stack2JS.hs

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -137,26 +137,26 @@ instance Identifier Raw.Assignable where
137137
class ToJS a where
138138
toJS :: a -> W PP.Doc
139139

140-
141-
142140
irProg2JSString :: CompileMode -> Bool -> StackProgram -> String
143141
irProg2JSString compileMode debugOut ir =
144142
let (fns, _, (_,_,konts)) = runRWS (toJS ir) debugOut initState
145143
inner = vcat (fns:konts)
146144
outer = vcat $
147145
stdlib
148146
++
149-
[ "function" <+> ppNamespaceName <+> text "(rt) {" ]
147+
[ "function" <+> namespaceName <+> text "(rt) {" ]
150148
++
151149
[ nest 2 inner
152150
, text "}" ]
153151
++
154152
suffix
155-
in
153+
in
156154
PP.render $
157155
case compileMode of
158156
Normal -> outer
159157
Export -> inner
158+
where -- TODO: should be generating a new namespace per received blob
159+
namespaceName = text "Top"
160160

161161

162162
stack2JSString :: StackUnit -> String
@@ -191,21 +191,6 @@ instance ToJS IR.VarAccess where
191191
return $ text fname
192192

193193

194-
-- instance (Identifier a) => ToJS a where
195-
-- toJS x = return $ ppId x
196-
197-
ppNamespaceName = text "Top" -- should be generating a new namespace per received blob
198-
199-
200-
irProg2JsWrapped prog = do
201-
inner <- toJS prog
202-
return $
203-
text "function" <+> ppNamespaceName <+> text "(rt) {"
204-
$$ nest 2 inner
205-
$$ text "}"
206-
207-
208-
209194
instance ToJS StackProgram where
210195
toJS (StackProgram atoms funs) = do
211196
jjA <- toJS atoms

0 commit comments

Comments
 (0)