1module Generate.JavaScript.Helpers where
3import Language.ECMAScript3.Syntax
12varDecl :: String -> Expression () -> VarDecl ()
14 VarDecl () (var x) (Just expr)
17refOrObject :: String -> Expression ()
19 InfixExpr () OpLOr (ref name) (ObjectLit () [])
31ref :: String -> Expression ()
36prop :: String -> Prop ()
41obj :: [String] -> Expression ()
45 foldl (DotRef ()) (ref x) (map var xs)
48 error "dotSep must be called on a non-empty list of variables"
55(<|) :: Expression () -> Expression () -> Expression ()
60function :: [String] -> [Statement ()] -> Expression ()
62 FuncExpr () Nothing (map var args) stmts
65call :: Expression () -> [Expression ()] -> Expression ()
74equal :: Expression () -> Expression () -> Expression ()
76 InfixExpr () OpStrictEq a b
79instanceof :: String -> Expression () -> Expression ()
81 InfixExpr () OpLAnd (typeof "object" x) (InfixExpr () OpInstanceof x (ref tipe))
84typeof :: String -> Expression () -> Expression ()
86 equal (PrefixExpr () PrefixTypeof x) (StringLit () tipe)
89member :: String -> Expression () -> Expression ()
91 InfixExpr () OpIn (StringLit () 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