on master help sign in
Stop trying to convert JS values as they flow out

resolves elm-lang/core #22

commit530fe174e8e8eb45a68fa837013e6133199fc8b1 authorEvan Czaplicki <info@elm-lang.org> dateSat 29 Nov 2014, 14:12 (12 years ago) parente5e55b1
1 file changed+5−1
src/Generate/JavaScript/Ports.hs+5−1
src/Generate/JavaScript/Ports.hs+5−1
@@ -56,6 +56,7 @@ incoming tipe =
5656
5757 _ -> ["v"] ==> inc tipe (ref "v")
5858
59+
5960inc :: CanonicalType -> Expression () -> Expression ()
6061inc tipe x =
6162 case tipe of
@@ -114,6 +115,7 @@ inc tipe x =
114115 keys = map convert fields
115116 convert (f,t) = (prop f, inc t (DotRef () x (var f)))
116117
118+
117119incomingTuple :: [CanonicalType] -> Expression () -> Expression ()
118120incomingTuple types x =
119121 check x JSArray (ObjectLit () fields)
@@ -127,6 +129,7 @@ incomingTuple types x =
127129 , inc t (BracketRef () x (IntLit () n))
128130 )
129131
132+
130133outgoing :: CanonicalType -> Expression ()
131134outgoing tipe =
132135 case tipe of
@@ -137,6 +140,7 @@ outgoing tipe =
137140
138141 _ -> ["v"] ==> out tipe (ref "v")
139142
143+
140144out :: CanonicalType -> Expression () -> Expression ()
141145out tipe x =
142146 case tipe of
@@ -163,7 +167,7 @@ out tipe x =
163167 | name `elem` ["Int","Float","Bool","String"] -> x
164168
165169 Type name
166− | Var.isJson name -> V.value ["Native","Json"] "toJS" <| x
170+ | Var.isJson name -> x
167171 | Var.isTuple name -> ArrayLit () []
168172 | otherwise -> error "bad type got to outgoing port generation code"
169173