Skip to content

Commit

Permalink
Some jugling with module and JS functions
Browse files Browse the repository at this point in the history
  • Loading branch information
norm2782 committed Oct 19, 2011
1 parent 15a0738 commit abf2740
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FLAGS = -tjscript --dump-core-stages=1 --dump-grin-stages=1 -O1,2 --gen-trace=1
FLAGS = -tjscript --dump-core-stages=1 --dump-grin-stages=1 -O1,2 --gen-trace=1 --import-path=../../../uhc-jscript/src

ifndef PROJECT
PROJECT = $(patsubst %.hs, %, $(wildcard *.hs))
Expand Down
8 changes: 6 additions & 2 deletions uhc-jscript/src/Language/UHC/JScript/Assorted.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
module Language.UHC.JScript.Assorted where

import Language.UHC.JScript.ECMA.String
import Language.UHC.JScript.Types
import Language.UHC.JScript.Primitives

foreign import jscript "alert(%*)"
alert :: JSString -> IO ()
alert :: String -> IO ()
alert = _alert . toJS

foreign import jscript "alert(%*)"
_alert :: JSString -> IO ()
9 changes: 7 additions & 2 deletions uhc-jscript/src/Language/UHC/JScript/ECMA/Expressions.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
module Language.UHC.JScript.ECMA.Expressions where

foreign import jscript "typeof(%*)"
typeof :: a -> JSString
import Language.UHC.JScript.ECMA.String
import Language.UHC.JScript.Types
import Language.UHC.JScript.Primitives

typeof :: a -> String
typeof = fromJS . _typeof

foreign import jscript "typeof(%*)"
_typeof :: a -> JSString

0 comments on commit abf2740

Please sign in to comment.