domenic / promises-unwrapping

The ES6 promises spec, as per September 2013 TC39 meeting
1.23k stars 94 forks source link

Should cleanup steps be included or omitted? #59

Closed domenic closed 10 years ago

domenic commented 10 years ago

Question for @allenwb: in PropagateToDerived, I clean up the [[Derived]] List:

"Set the value of p's [[Derived]] internal data property to a new empty List."

This is not strictly necessary, as after this point [[Derived]] will never be touched again. But it seems nice to include, as without it, naive implementations following the spec will leak memory.

Thoughts?

domenic commented 10 years ago

Given how in https://github.com/domenic/promises-unwrapping/issues/36#issuecomment-26389422 @allenwb explicitly sets internal slots to undefined in order to ensure proxy targets and handlers are garbage-collectable, I think we have our answer: cleanup steps are indeed necessary.