andreasgal / finalize.js

Garbage collector callbacks for JavaScript/node

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error handling

nickdesaulniers opened this issue · comments

in the case where a strong reference cannot be obtained, there is no signaling to the caller that the object was gc'ed.

The check if (!strongref) will fail if the gc happens to run between statements (is that possible in node?)

some ideas on lack of strongref, either:

  1. call the callback, with the first arg an error obj (with this possibly set to null)
  2. return a Boolean from finalize
  3. throw an Error