on a950bc5 help sign in
32 lines 761 B history raw
1module Generate.JavaScript.Crash where
3import Language.ECMAScript3.Syntax (Expression)
5import Generate.JavaScript.Helpers (call, obj, ref, string)
6import qualified Reporting.Crash as Crash
7import qualified Reporting.Region as R
10localModuleName :: String
11localModuleName =
12 "$moduleName"
15crash :: Crash.Details -> Expression ()
16crash details =
17 case details of
18 Crash.IncompleteMultiIf region ->
19 obj ["_U","badIf"]
20 `call`
21 [ ref localModuleName
22 , string (R.toString region)
23 ]
25 Crash.IncompletePatternMatch _region ->
26 obj ["_U","badCase"]
27 `call`
28 [ ref localModuleName
29 , string "bugs in reporting the exact location right now" -- TODO
30 ]