TooTallNate/node-weak

Should have separate enumerator for property names vs. property indices

kunalspathak opened this issue · 0 comments

During initialization of weakref, SetIndexedPropertyHandler() sets the same enumerator i.e. WeakPropertyEnumerator which is also set in SetNamedPropertyHandler(). If we have an code:

var obj = {a : 'a'};
var x = weak(obj);
console.log(x); 

The last line prints 'a' twice -- once each extracted using SetindexedPropertyHandler and SetNamedPropertyHandler using same WeakPropertyEnumerator.
Having a separate enumerator for indexed properties would help in not extracting named properties from object.