DelSkayn / rquickjs

High level bindings to the quickjs javascript engine
MIT License
434 stars 59 forks source link

Invert #[qjs(skip_trace)] -> #[qjs(trace)] #195

Closed richarddd closed 9 months ago

richarddd commented 11 months ago

Isn't it better to tell what to trace than what not to trace in the derive? #[qjs(skip_trace)] should in my opinion be inverted and be used as #[qjs(trace)] on fields we want to trace.

DelSkayn commented 9 months ago

I personally prefer to always lean towards doing the safe and correct thing by default and error when it is not supported. Which I find is how rust generally does things. Failing to trace can result in aborts or memory leaks so this is why I made the macro such that you need to manually mark fields to not be traced making the implementer think about whether a field could contain traceable pointers

richarddd commented 9 months ago

Makes sense!