Skip to content

Commit 34b384e

Browse files
authored
Merge pull request #1289 from NativeScript/trifonov/debugger-fix
Debugger fix
2 parents 9fa2e1f + 1d2eb5d commit 34b384e

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
5.2.1
2+
==
3+
4+
## Bug Fixes
5+
- [Breakpoint stop to hit when you have two open tabs and close one(#1247)](https://github.com/NativeScript/android-runtime/issues/1247)
6+
17
5.2.0
28
==
39

@@ -13,7 +19,6 @@
1319
- [ClassNotFound exception when calling nested static class with correct argument(#1195)](https://github.com/NativeScript/android-runtime/issues/1195)
1420
- [If you refresh or close the chrome dev tools window an error will be log in the console (#1202)](https://github.com/NativeScript/android-runtime/issues/1202)
1521
- [Debug on Android fails when stopped on breakpoint and change in .xml/.css/.html is applied(#1243)](https://github.com/NativeScript/android-runtime/issues/1243)
16-
- [Breakpoint stop to hit when you have two open tabs and close one(#1247)](https://github.com/NativeScript/android-runtime/issues/1247)
1722
- [Upgrade V8 to v7 to fix unstable sort() method(#1176)](https://github.com/NativeScript/android-runtime/issues/1176)
1823
- [CodeCache option is broken since Android Runtime 4.1.0(#1235)](https://github.com/NativeScript/android-runtime/issues/1235)
1924
- [Snapshots with ABI splits do not work since Android Runtime 4.1.0(#1234)](https://github.com/NativeScript/android-runtime/issues/1234)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "tns-android",
33
"description": "NativeScript Runtime for Android",
4-
"version": "5.2.0",
4+
"version": "5.2.1",
55
"repository": {
66
"type": "git",
77
"url": "https://github.com/NativeScript/android-runtime.git"

test-app/app/src/main/java/com/tns/AndroidJsV8Inspector.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,22 @@ protected Response serveHttp(IHTTPSession session) {
231231
return super.serveHttp(session);
232232
}
233233

234+
private JsV8InspectorWebSocket webSocket;
235+
234236
@Override
235237
protected WebSocket openWebSocket(IHTTPSession handshake) {
236-
return new JsV8InspectorWebSocket(handshake, currentRuntimeLogger);
238+
// close the previous webSocket
239+
if(this.webSocket != null) {
240+
try {
241+
this.webSocket.close(WebSocketFrame.CloseCode.NormalClosure, "New browser connection is open", false);
242+
} catch (IOException ioException) {
243+
if(this.webSocket.getState() != State.CLOSED) {
244+
Log.e("{N}.v8-inspector", "Error closing previous connection", ioException);
245+
}
246+
}
247+
}
248+
this.webSocket = new JsV8InspectorWebSocket(handshake, currentRuntimeLogger);
249+
return this.webSocket;
237250
}
238251
}
239252

0 commit comments

Comments
 (0)