[Git][ghc/ghc][wip/9.6.5-backports] Cherry pick

Zubin (@wz1000) gitlab at gitlab.haskell.org
Mon Apr 15 07:44:26 UTC 2024



Zubin pushed to branch wip/9.6.5-backports at Glasgow Haskell Compiler / GHC


Commits:
21ab2c1f by Zubin Duggal at 2024-04-15T13:13:21+05:30
Cherry pick

* Fix some primitives defined in GHC.JS.Prim

from

Base/JS: GHC.JS.Foreign.Callback module (issue 23126)

(cherry picked from commit 27d2978e5412f2bef4448e208182a03137dd5ee8)

- - - - -


1 changed file:

- libraries/base/GHC/JS/Prim.hs


Changes:

=====================================
libraries/base/GHC/JS/Prim.hs
=====================================
@@ -277,13 +277,13 @@ foreign import javascript unsafe "(($1) => { return ($1 === null); })"
 foreign import javascript unsafe "(($1) => { return ($1 === undefined); })"
   js_isUndefined :: JSVal -> Bool
 
-foreign import javascript unsafe "(($1) => { return ($r = typeof($1) === 'number' ? ($1|0) : 0;); })"
+foreign import javascript unsafe "(($1) => { return (typeof($1) === 'number' ? ($1|0) : 0); })"
   js_fromJSInt :: JSVal -> Int
 
-foreign import javascript unsafe "(($1) => { return ($r = $1;); })"
+foreign import javascript unsafe "(($1) => { return $1; })"
   js_toJSInt :: Int -> JSVal
 
-foreign import javascript unsafe "$r = null;"
+foreign import javascript unsafe "(() => { return null; })"
   js_null :: JSVal
 
 foreign import javascript unsafe "(($1,$2) => { return $1[h$fromHsString($2)]; })"
@@ -307,7 +307,6 @@ foreign import javascript unsafe "(($1,$2_1,$2_2) => { return $1[h$decodeUtf8z($
 foreign import javascript unsafe "(($1_1,$1_2) => { return h$decodeUtf8z($1_1, $1_2); })"
   js_unpackJSStringUtf8## :: Addr# -> State# s -> (# State# s, JSVal# #)
 
-
 foreign import javascript unsafe "(($1_1, $1_2) => { return h$decodeUtf8z($1_1,$1_2); })"
   js_unsafeUnpackJSStringUtf8## :: Addr# -> JSVal#
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/21ab2c1f09d20b03d9d6feb4ab526adda0a53bc1

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/21ab2c1f09d20b03d9d6feb4ab526adda0a53bc1
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240415/747ec335/attachment-0001.html>


More information about the ghc-commits mailing list