File tree Expand file tree Collapse file tree 3 files changed +5
-6
lines changed
bolt-connection/src/channel/browser
neo4j-driver-deno/lib/bolt-connection/channel/browser
neo4j-driver-lite/test/integration Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -166,10 +166,10 @@ export default class WebSocketChannel {
166
166
*/
167
167
close ( ) {
168
168
return new Promise ( ( resolve , reject ) => {
169
+ this . _clearConnectionTimeout ( )
169
170
if ( this . _ws && this . _ws . readyState !== WS_CLOSED ) {
170
171
this . _open = false
171
172
this . stopReceiveTimeout ( )
172
- this . _clearConnectionTimeout ( )
173
173
this . _ws . onclose = ( ) => resolve ( )
174
174
this . _ws . close ( )
175
175
} else {
Original file line number Diff line number Diff line change @@ -166,10 +166,10 @@ export default class WebSocketChannel {
166
166
*/
167
167
close ( ) {
168
168
return new Promise ( ( resolve , reject ) => {
169
+ this . _clearConnectionTimeout ( )
169
170
if ( this . _ws && this . _ws . readyState !== WS_CLOSED ) {
170
171
this . _open = false
171
172
this . stopReceiveTimeout ( )
172
- this . _clearConnectionTimeout ( )
173
173
this . _ws . onclose = ( ) => resolve ( )
174
174
this . _ws . close ( )
175
175
} else {
Original file line number Diff line number Diff line change @@ -23,10 +23,9 @@ class BrowserEnvironment extends NodeEnvironment {
23
23
async setup ( ) {
24
24
await super . setup ( )
25
25
this . global . WebSocket = WebSocket
26
- this . global . window = {
27
- navigator : {
28
- userAgent : 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36'
29
- }
26
+ this . global . window = globalThis
27
+ this . global . window . navigator = {
28
+ userAgent : 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36'
30
29
}
31
30
}
32
31
You can’t perform that action at this time.
0 commit comments