|
1 | 1 | 'use strict'; |
2 | 2 |
|
3 | | -const ref = require('ref-napi'); |
4 | 3 | const ffi = require('ffi-napi'); |
| 4 | +const ref = require('ref-napi'); |
5 | 5 |
|
6 | 6 | const { |
7 | 7 | error, |
@@ -296,23 +296,23 @@ const EventApi = ffi.Library('kernel32', { |
296 | 296 | }); |
297 | 297 |
|
298 | 298 | /** Finalizer for RegistryKey to ensure the underlying registry key handle is closed. */ |
299 | | -const RegistryKeyFinalizer = new FinalizationRegistry(registryKeyData => { |
| 299 | +const registryKeyFinalizer = new FinalizationRegistry(registryKeyData => { |
300 | 300 | if (registryKeyData.handle !== null) { |
301 | 301 | warning(`RegistryKey ${registryKeyData.path} is not properly closed! You should call RegistryKey.close() or Registry.closeKey() to close a key when it is no longer needed!`); |
302 | 302 | Registry.instance.closeKeyInternal(registryKeyData); |
303 | 303 | } |
304 | 304 | }); |
305 | 305 |
|
306 | 306 | /** Finalizer for MonitoredRegistryKey to ensure the underlying event handle is closed. */ |
307 | | -const MonitoredRegistryKeyFinalizer = new FinalizationRegistry(monitorData => { |
| 307 | +const monitoredRegistryKeyFinalizer = new FinalizationRegistry(monitorData => { |
308 | 308 | if (monitorData.waitHandle !== null) { |
309 | 309 | warning(`MonitoredRegistryKey ${registryKeyData.path} is not properly stopped! You should call Registry.stopMonitor() to stop monitoring a key when it is no longer needed!`); |
310 | 310 | Registry.instance.stopMonitoredKeyInternal(monitorData); |
311 | 311 | } |
312 | 312 | }); |
313 | 313 |
|
314 | 314 | /** Finalizer for MonitorToken to ensure the callback is unregistered. */ |
315 | | -const MonitorTokenFinalizer = new FinalizationRegistry(tokenData => { |
| 315 | +const monitorTokenFinalizer = new FinalizationRegistry(tokenData => { |
316 | 316 | if (!tokenData.calback !== null) { |
317 | 317 | warning(`MonitorToken on key ${tokenData.path} is not properly removed! You should call MonitorToken.stop() or Registry.stopMonitor() to stop monitoring a key when it is no longer needed!`); |
318 | 318 | Registry.instance.stopMonitorInternal(tokenData); |
@@ -356,7 +356,7 @@ class RegistryKey { |
356 | 356 | this.open(); |
357 | 357 |
|
358 | 358 | // Register this key in finalizer so we can be alerted if it's not properly closed |
359 | | - RegistryKeyFinalizer.register(this, this.keyData); |
| 359 | + registryKeyFinalizer.register(this, this.keyData); |
360 | 360 | } |
361 | 361 |
|
362 | 362 | /** |
@@ -740,7 +740,7 @@ class MonitoredRegistryKey extends RegistryKey { |
740 | 740 | this.start(); |
741 | 741 |
|
742 | 742 | // Register this key in finalizer so we can be alerted if it's not properly stopped |
743 | | - MonitoredRegistryKeyFinalizer.register(this, this.monitorData); |
| 743 | + monitoredRegistryKeyFinalizer.register(this, this.monitorData); |
744 | 744 | } |
745 | 745 |
|
746 | 746 | /** |
@@ -898,7 +898,7 @@ class MonitorToken { |
898 | 898 | }; |
899 | 899 |
|
900 | 900 | // Register this token in finalizer so we can be alerted if it's not properly stopped |
901 | | - MonitorTokenFinalizer.register(this, this.tokenData); |
| 901 | + monitorTokenFinalizer.register(this, this.tokenData); |
902 | 902 | } |
903 | 903 |
|
904 | 904 | /** |
|
0 commit comments