Skip to content

Commit f76af24

Browse files
committed
Fix deno close sequence
1 parent 5097345 commit f76af24

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

deno/polyfills.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export const net = {
108108
}
109109

110110
if (!socket.encrypted || encrypted)
111-
close()
111+
closed()
112112
}
113113

114114
function close() {
@@ -118,16 +118,15 @@ export const net = {
118118
if (e instanceof Deno.errors.BadResource === false)
119119
call(socket.events.error, e)
120120
}
121-
closed()
122121
}
123122

124123
function closed() {
125124
if (socket.readyState === 'closed')
126125
return
127126

128127
socket.break = socket.encrypted = false
129-
call(socket.events.close)
130128
socket.readyState = 'closed'
129+
call(socket.events.close)
131130
}
132131

133132
function error(err) {

0 commit comments

Comments
 (0)