1module Generate.JavaScript.Helpers where
3import AST.Annotation (Region)
4import qualified AST.PrettyPrint as PP
5import Language.ECMAScript3.Syntax
14ref :: String -> Expression ()
19prop :: String -> Prop ()
27obj :: [String] -> Expression ()
30 x:xs -> foldl (DotRef ()) (ref x) (map var xs)
31 [] -> error "dotSep must be called on a non-empty list of variables"
36localModuleName :: String
41throw :: String -> Region -> Expression ()
45 , string (PP.renderPretty region)
48 obj ["_U",kind] `call` args
53(<|) :: Expression () -> Expression () -> Expression ()
58ret :: Expression () -> Statement ()
60 ReturnStmt () (Just e)
63(==>) :: [String] -> Expression () -> Expression ()
65 FuncExpr () Nothing (map var args) [ ret e ]
68function :: [String] -> [Statement ()] -> Expression ()
70 FuncExpr () Nothing (map var args) stmts
73call :: Expression () -> [Expression ()] -> Expression ()
80equal :: Expression () -> Expression () -> Expression ()
82 InfixExpr () OpStrictEq a b
85instanceof :: String -> Expression () -> Expression ()
87 InfixExpr () OpLAnd (typeof "object" x) (InfixExpr () OpInstanceof x (ref tipe))
90typeof :: String -> Expression () -> Expression ()
92 equal (PrefixExpr () PrefixTypeof x) (string tipe)
95member :: String -> Expression () -> Expression ()
97 InfixExpr () OpIn (string field) x
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list