File tree Expand file tree Collapse file tree 7 files changed +89
-4
lines changed Expand file tree Collapse file tree 7 files changed +89
-4
lines changed Original file line number Diff line number Diff line change 5
5
" llvm-vs-code-extensions.vscode-clangd" ,
6
6
" xadillax.gyp" ,
7
7
" dbaeumer.vscode-eslint" ,
8
- " esbenp.prettier-vscode"
8
+ " esbenp.prettier-vscode" ,
9
+ " vadimcn.vscode-lldb"
9
10
]
10
11
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "configurations" : [
3
+ {
4
+ "name" : " JS-Attach" ,
5
+ "type" : " node" ,
6
+ "request" : " attach" ,
7
+ "port" : 9229 ,
8
+ "continueOnAttach" : true ,
9
+ "autoAttachChildProcesses" : true ,
10
+ "resolveSourceMapLocations" : [
11
+ " !**/node_modules/**" ,
12
+ " !**/.vscode/extensions/hbenl.vscode-mocha-test-adapter-*/**"
13
+ ],
14
+ "skipFiles" : [
15
+ " <node_internals>/**"
16
+ ],
17
+ },
18
+ {
19
+ "type" : " lldb" ,
20
+ "request" : " launch" ,
21
+ "name" : " Native-Launch" ,
22
+ "preLaunchTask" : " clean_build_debug" ,
23
+ "program" : " node" ,
24
+ "suppressMultipleSessionWarning" : true ,
25
+ "sourceLanguages" : [
26
+ " cpp"
27
+ ],
28
+ "args" : [
29
+ " --inspect-brk=9229" ,
30
+ " --expose-gc" ,
31
+ " -r" ,
32
+ " ts-node/register" ,
33
+ " ${workspaceFolder}/test/debug.ts"
34
+ ],
35
+ }
36
+ ],
37
+ "compounds" : [
38
+ {
39
+ "name" : " Node-Launch" ,
40
+ "configurations" : [
41
+ " Native-Launch" ,
42
+ " JS-Attach" ,
43
+ ]
44
+ }
45
+ ]
46
+ }
Original file line number Diff line number Diff line change 3
3
"mochaExplorer.globImplementation" : " vscode" ,
4
4
"mochaExplorer.nodeArgv" : [
5
5
" --expose-gc"
6
- ]
6
+ ],
7
+ "mochaExplorer.debuggerConfig" : " JS-Attach"
7
8
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "version" : " 2.0.0" ,
3
+ "tasks" : [
4
+ {
5
+ "label" : " clean_build_debug" ,
6
+ "type" : " shell" ,
7
+ "command" : " pnpm clean.release && pnpm build.debug" ,
8
+ }
9
+ ]
10
+ }
Original file line number Diff line number Diff line change 84
84
"scripts" : {
85
85
"install" : " (shx test -f ./script/build.js || run-s build.js) && cross-env npm_config_build_from_source=true aminya-node-gyp-build" ,
86
86
"clean" : " shx rm -rf ./build ./lib/ ./prebuilds ./script/*.js ./script/*.js.map ./script/*.d.ts ./script/*.tsbuildinfo" ,
87
+ "clean.release" : " shx rm -rf ./build/Release" ,
87
88
"clean.temp" : " shx rm -rf ./tmp && shx mkdir -p ./tmp" ,
88
89
"build.library" : " tsc -p ./src/tsconfig.json" ,
89
90
"build.script" : " tsc -p ./script/tsconfig.json && tsc -p ./script/tsconfig.esm.json" ,
Original file line number Diff line number Diff line change
1
+ import * as zmq from "../src"
2
+
3
+ import { getGcOrSkipTest } from "./unit/helpers"
4
+
5
+ async function main ( ) {
6
+ const gc = getGcOrSkipTest ( )
7
+
8
+ let weakRef : undefined | WeakRef < zmq . Context >
9
+ const task = async ( ) => {
10
+ const context : zmq . Context | undefined = new zmq . Context ( )
11
+ const dealer = new zmq . Dealer ( { context, linger : 0 } )
12
+ weakRef = new WeakRef ( context )
13
+
14
+ // dealer.close()
15
+ }
16
+
17
+ await task ( )
18
+ await gc ( )
19
+
20
+ console . log ( weakRef ?. deref ( ) )
21
+ }
22
+
23
+ main ( ) . catch ( err => {
24
+ console . error ( err )
25
+ process . exit ( 1 )
26
+ } )
Original file line number Diff line number Diff line change @@ -259,9 +259,9 @@ interface GCFunction {
259
259
} ) : void | Promise < void >
260
260
}
261
261
262
- export function getGcOrSkipTest ( test : Mocha . Context ) {
262
+ export function getGcOrSkipTest ( test ? : Mocha . Context ) {
263
263
if ( process . env . SKIP_GC_TESTS === "true" ) {
264
- test . skip ( )
264
+ test ? .skip ( )
265
265
}
266
266
267
267
const gc = global . gc as undefined | GCFunction
You can’t perform that action at this time.
0 commit comments