on master help sign in
cosmetic: switch to modern indentation style in a `case`
commit45a823f78f730e1bc4de3b0f213ac03d7a124589 authorEvan Czaplicki <info@elm-lang.org> dateTue 17 Nov 2015, 11:28 (11 years ago) parente7a4551
1 file changed+22−10
src/Generate/JavaScript/Port.hs+22−10
src/Generate/JavaScript/Port.hs+22−10
@@ -83,19 +83,31 @@ check x jsType continue =
8383
8484 checks =
8585 case jsType of
86− JSNumber -> [typeof "number"]
86+ JSNumber ->
87+ [typeof "number"]
88+
8789 JSInt ->
88− [jsFold OpLAnd (typeof "number" : intChecks)]
89− JSBoolean -> [typeof "boolean"]
90− JSString -> [typeof "string", instanceof "String"]
91− JSArray -> [instanceof "Array"]
90+ [jsFold OpLAnd intChecks]
91+
92+ JSBoolean ->
93+ [typeof "boolean"]
94+
95+ JSString ->
96+ [typeof "string", instanceof "String"]
97+
98+ JSArray ->
99+ [instanceof "Array"]
100+
92101 JSObject fields ->
93− [jsFold OpLAnd (typeof "object" : map member fields)]
102+ [jsFold OpLAnd (typeof "object" : map member fields)]
103+
94104
95− intChecks =
96− [ \x -> ref "isFinite" <| x
97− , \x -> equal (obj ["Math","floor"] <| x) x
98− ]
105+intChecks :: [Expression () -> Expression ()]
106+intChecks =
107+ [ typeof "number"
108+ , \x -> ref "isFinite" <| x
109+ , \x -> equal (obj ["Math","floor"] <| x) x
110+ ]
99111
100112
101113-- INBOUND