ghcjs / ghcjs-base

base library for GHCJS for JavaScript interaction and marshalling, used by higher level libraries like JSC
MIT License
45 stars 67 forks source link

Fix two typos for websockets #54

Closed drwebb closed 8 years ago

drwebb commented 8 years ago

Hi,

I ran across two off by one bugs while trying to open a websocket connection for some code I was working on.

JavaScript/Web/MessageEvent.hs

The conditional checking the type of the MessageEvent was returning inverted values for the two Binary types. See getData right above the change.

JavaScript/Web/WebSocket.hs

Checking the binaryType property of a websocket object was returning a Int which is fed into a toEnum starting at value 1, instead of 0.

bergey commented 8 years ago

Thanks!