On 05/08/2014 09:06 PM, Keegan McAllister wrote:
There is also the question of what handles to store within the parser.
- We could root every node as it's created, and unroot when the parser
is destroyed. We'd store JSRef<Node>, transmuting away the lifetimes.
- We could root the parser itself, make it traceable, and store JS<Node>.
This seems safer, but would complicate the generic interface further.
This is all a bit moot if a parser never lives across a JS operation that could
GC. But I wouldn't bet on that always being the case. The current Hubbub
bindings basically make this assumption, though; see
http://irclog.gr/#show/irc.mozilla.org/servo/103713
Creating a new JS reflector can GC, so that option is unworkable without
being very careful. Storing Root<Node> instead of JSRef<Node> probably
makes more sense, since the JSRefs cannot outlive the lifetime of their
stack root.
Cheers,
JOsh
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo