Skip to content

Commit 070a5d5

Browse files
committed
readPropImpl now checks for null and undefined of its arg.
1 parent 8ac9fc6 commit 070a5d5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Data/Foreign.purs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ foreign import readMaybeImpl
5050
readMaybeImpl' :: Foreign -> Maybe Foreign
5151
readMaybeImpl' = runFn3 readMaybeImpl Nothing Just
5252

53+
-- We use == to check for both null and undefined
5354
foreign import readPropImpl
5455
"function readPropImpl(k, obj) { \
55-
\ return obj === undefined ? undefined : obj[k];\
56+
\ return obj == undefined ? undefined : obj[k];\
5657
\}" :: forall a. Fn2 String Foreign Foreign
5758

5859
readPropImpl' :: String -> Foreign -> Foreign

0 commit comments

Comments
 (0)