on master help sign in
cosmetic: switch to modern indentation style in a `case`
45a823fEvan Czaplicki
src/Generate/JavaScript/Port.hs+22−10
@@ -83,19 +83,31 @@ check x jsType continue =
83
83
84 checks =
84 checks =
85 case jsType of
85 case jsType of
86+ JSNumber ->
86− JSNumber -> [typeof "number"]
87+ [typeof "number"]
88+
87 JSInt ->
89 JSInt ->
88− [jsFold OpLAnd (typeof "number" : intChecks)]
90+ [jsFold OpLAnd intChecks]
91+
92+ JSBoolean ->
89− JSBoolean -> [typeof "boolean"]
93+ [typeof "boolean"]
94+
95+ JSString ->
90− JSString -> [typeof "string", instanceof "String"]
96+ [typeof "string", instanceof "String"]
97+
98+ JSArray ->
91− JSArray -> [instanceof "Array"]
99+ [instanceof "Array"]
100+
92 JSObject fields ->
101 JSObject fields ->
93− [jsFold OpLAnd (typeof "object" : map member fields)]
102+ [jsFold OpLAnd (typeof "object" : map member fields)]
103+
94
104
95− intChecks =
105+intChecks :: [Expression () -> Expression ()]
106+intChecks =
107+ [ typeof "number"
96− [ \x -> ref "isFinite" <| x
108+ , \x -> ref "isFinite" <| x
97− , \x -> equal (obj ["Math","floor"] <| x) x
109+ , \x -> equal (obj ["Math","floor"] <| x) x
98− ]
110+ ]
99
111
100
112
101-- INBOUND
113-- INBOUND