文件名称:finalize.js:JavaScriptnode的垃圾收集器回调
文件大小:2KB
文件格式:ZIP
更新时间:2024-05-25 07:54:55
Java
敲定 节点模块为对象注册垃圾回收器回调 用法 var finalize = require ( 'finalize' ) ; var obj = { x : 1337 } ; finalize ( obj , function ( ) { console . log ( this . x ) ; // this will print '1337' } ) ; global . gc ( ) ; // nothing will happen, var obj above holds obj alive obj = null ; global . gc ( ) ; // the previous line should trigger the callback above
【文件预览】:
finalize.js-master
----finalize.js(621B)
----test.js(291B)
----README.md(401B)
----package.json(492B)