Struct boa::object::RecursionLimiter [−][src]
Expand description
Prevents infinite recursion during Debug::fmt, JSON.stringify, and other conversions.
This uses a thread local, so is not safe to use where the object graph will be traversed by
multiple threads!
Fields
visited: boolIf this JsObject has been visited before in the graph, but not in the current branch.
live: boolIf this JsObject has been visited in the current branch of the graph.
Implementations
Determines if the specified JsObject has been visited, and returns a struct that will free it when dropped.
This is done by maintaining a thread-local hashset containing the pointers of JsObject values that have been
visited. The first JsObject visited will clear the hashset, while any others will check if they are contained
by the hashset.