@nativescript/windows 0.1.0-alpha.12 → 0.1.0-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,6 +36,9 @@ namespace __PROJECT_NAME__
36
36
  [DllImport(NativeScriptLibrary, EntryPoint = nameof(runtime_free_js_error))]
37
37
  private static extern void runtime_free_js_error(IntPtr ptr);
38
38
 
39
+ [DllImport(NativeScriptLibrary, EntryPoint = nameof(runtime_has_devtools))]
40
+ private static extern bool runtime_has_devtools();
41
+
39
42
  #if DEBUG
40
43
  [DllImport(NativeScriptLibrary, EntryPoint = nameof(runtime_devtools_start))]
41
44
  private static extern IntPtr runtime_devtools_start(long runtime, ushort port);
@@ -48,17 +51,12 @@ namespace __PROJECT_NAME__
48
51
 
49
52
  public string DevtoolsFrontendUrl { get; private set; }
50
53
 
51
- private bool _devtoolsPumpAvailable = true;
54
+ private bool _devtoolsAvailable;
52
55
 
53
56
  public void PumpDevtools()
54
57
  {
55
- if (!_initialized || !_devtoolsPumpAvailable) return;
58
+ if (!_initialized || !_devtoolsAvailable) return;
56
59
  try { runtime_devtools_pump(_runtime); }
57
- catch (System.EntryPointNotFoundException)
58
- {
59
- // DLL built without devtools feature — stop trying.
60
- _devtoolsPumpAvailable = false;
61
- }
62
60
  catch (Exception ex)
63
61
  {
64
62
  System.Diagnostics.Debug.WriteLine($"[NativeScript DevTools] Pump failed: {ex.Message}");
@@ -67,6 +65,7 @@ namespace __PROJECT_NAME__
67
65
 
68
66
  private void StartDevtoolsSafely()
69
67
  {
68
+ if (!runtime_has_devtools()) return;
70
69
  IntPtr urlPtr = IntPtr.Zero;
71
70
  try
72
71
  {
@@ -77,7 +76,10 @@ namespace __PROJECT_NAME__
77
76
  ? $"devtools://devtools/bundled/inspector.html?ws={wsUrl.Replace("ws://", "")}"
78
77
  : null;
79
78
  if (DevtoolsFrontendUrl != null)
79
+ {
80
+ _devtoolsAvailable = true;
80
81
  System.Diagnostics.Debug.WriteLine($"[NativeScript DevTools] {DevtoolsFrontendUrl}");
82
+ }
81
83
  }
82
84
  catch (Exception ex)
83
85
  {
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nativescript/windows",
3
- "version": "0.1.0-alpha.12",
3
+ "version": "0.1.0-alpha.13",
4
4
  "description": "NativeScript for using Windows v8",
5
5
  "repository": {
6
6
  "type": "git",