Skip to content
Browse files

Merge branch 'master' of github.com:spockz/uhc-jscript

  • Loading branch information...
2 parents d477c9f + ec406a3 commit 0c90744300aeabcb0a550539395729240ba372e2 @spockz spockz committed Jan 9, 2012
View
9 uhc-jscript/src/Language/UHC/JScript/ECMA/String.hs
@@ -20,15 +20,6 @@ instance FromJS JSString String where
jsStringToString :: JSString -> String
jsStringToString = packedStringToString
-foreign import jscript "primPackedStringNull"
- primPackedStringNull :: JSString -> Bool
-
-foreign import jscript "primPackedStringHead"
- primPackedStringHead :: JSString -> Char
-
-foreign import jscript "primPackedStringTail"
- primPackedStringTail :: JSString -> JSString
-
foreign import jscript "String.fromCharCode(%*)"
fromCharCode :: Int -> JSString
View
10 uhc-jscript/src/Language/UHC/JScript/Primitives.hs
@@ -41,15 +41,18 @@ setCtor s1 fp = _setCtor (toJS s1) fp
foreign import prim "primSetCtor"
_setCtor :: JSString -> JSFunPtr a -> IO ()
-getAttr :: String -> JSPtr p -> a
+getAttr :: String -> JSPtr p -> IO a
getAttr s p = _getAttr (toJS s) p
foreign import prim "primGetAttr"
- _getAttr :: JSString -> JSPtr p -> a
+ _getAttr :: JSString -> JSPtr p -> IO a
setAttr :: String -> a -> JSPtr p -> IO (JSPtr p)
setAttr s a p = _setAttr (toJS s) a p
+setAttr_ :: String -> a -> JSPtr p -> IO ()
+setAttr_ s a p = setAttr s a p >> return ()
+
foreign import prim "primSetAttr"
_setAttr :: JSString -> a -> JSPtr p -> IO (JSPtr p)
@@ -62,6 +65,9 @@ foreign import prim "primPureSetAttr"
modAttr :: String -> (a -> b) -> JSPtr p -> IO (JSPtr p)
modAttr s f p = _modAttr (toJS s) f p
+modAttr_ :: String -> (a -> b) -> JSPtr p -> IO ()
+modAttr_ s f p = modAttr s f p >> return ()
+
foreign import prim "primModAttr"
_modAttr :: JSString -> (a -> b) -> JSPtr p -> IO (JSPtr p)

0 comments on commit 0c90744

Please sign in to comment.
Something went wrong with that request. Please try again.