silverstripe/silverstripe-framework — pull request #2149 by hafriedlander (2013-06-25 03:26:46+00:00)
Title: FIX Arguments to method calls reseting scope

Alternative method of fixing https://github.com/silverstripe/silverstripe-framework/pull/2028 which doesn't involve cloning scope.

Works by rewriting Lookup elements to extract elements first. That is,

```
$A.B($C.D($E.F, $G.H))
```
becomes effectively
```
$v1 = $E.F; $v2 = $G.H; $v3 = $C.D($v1, $v2); return $A.B($v3);
```

Although this should work with short circuiting I need to add more tests to make sure - although no method called in a template should have a side effect anyway.