operasoftware/operadriver — pull request #54 by rjatkins (2012-01-22 06:24:02+00:00)
Title: Handle cyclic references in javascript results, to avoid stack overflow

If the result of any javascript executed contains any cyclic references (that is, some object points to itself either directly, or via any other chain of objects), then OperaDriver 0.10 will get a stack overflow while trying to examine the results. This fix cuts that out in the simplest way: it returns a null in the deepest parts of the result tree where there would have been a back-reference.

If it turns out that test code actually relies on the cyclic references being non-null, an interested implementor can look at adding placeholders and a backpatch map to track which placeholders need replacing.