Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1 from norm2782/master

Attr-related changes
  • Loading branch information...
commit ec406a3a3f3ea7b62a863492d1477479bdc2336e 2 parents b52b24d + a8e2a52
@spockz spockz authored
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 ec406a3

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