define :: String -> JS.Expression () -> JS.Statement ()
define name body =
  if Help.isOp name then
    let
      root =
        JS.VarRef () (JS.Id () "_op")

      lvalue =
        JS.LBracket () root (JS.StringLit () name)
    in
      JS.ExprStmt () (JS.AssignExpr () JS.OpAssign lvalue body)

  else
    JS.VarDeclStmt () [ JS.VarDecl () (JS.Id () (safe name)) (Just body) ]
define :: String -> JS.Expression () -> JS.Statement ()
define name body =
  if Help.isOp name then
    let
      root =
        JS.VarRef () (JS.Id () "_op")

      lvalue =
        JS.LBracket () root (JS.StringLit () name)
    in
      JS.ExprStmt () (JS.AssignExpr () JS.OpAssign lvalue body)

  else
    JS.VarDeclStmt () [ JS.VarDecl () (JS.Id () (safe name)) (Just body) ]
define name body =
  if Help.isOp name then
    let
      root =
        JS.VarRef () (JS.Id () "_op")

      lvalue =
        JS.LBracket () root (JS.StringLit () name)
    in
      JS.ExprStmt () (JS.AssignExpr () JS.OpAssign lvalue body)

  else
    JS.VarDeclStmt () [ JS.VarDecl () (JS.Id () (safe name)) (Just body) ]