Use all WebSocket.close args for WIN platforms. (#16)

This commit is contained in:
Julio César Rocha 2019-03-22 04:58:43 -07:00 коммит произвёл microsoft-github-bot[bot]
Родитель 68f15f4a13
Коммит bffa7456a7
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -224,7 +224,7 @@ class WebSocket extends EventTarget(...WEBSOCKET_EVENTS) {
}
_close(code?: number, reason?: string): void {
if (Platform.OS === 'android') {
if (Platform.OS === 'android' || Platform.OS === 'win32' || Platform.OS == 'windesktop') {
// See https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent
const statusCode = typeof code === 'number' ? code : CLOSE_NORMAL;
const closeReason = typeof reason === 'string' ? reason : '';