summaryrefslogtreecommitdiff
path: root/testsuite/tests/javascript/js-ffi-isUndefined.hs
blob: 29511d02769ec43d343f930b24cef0fad7fc2c6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import GHC.JS.Prim

foreign import javascript "((x) => { return undefined; })"
  js_undefined :: JSVal

main :: IO ()
main = do
  print (isUndefined js_undefined)
  print (isUndefined $ toJSString "")
  print (isUndefined $ toJSString "test")
  print (isUndefined $ toJSInt 0)
  print (isUndefined $ toJSInt 1)
  print (isUndefined $ toJSInt 2)