angular/angular.js — pull request #7445 by ncuillery (2014-05-13 09:38:38+00:00)
Title: fix($rootScope): avoid unstable reference in $broadcast event

Request Type: bug

How to reproduce: Any case of asynchronous access to `event.currentScope` :
- `console.log(event)` then expand the object in console (Chrome / Firefox)
- Via `$timeout`
- In Jasmine expectation
[Plunker](http://plnkr.co/edit/YbsyEhzz81Mcd9TZdBwt?p=preview)

Note : The tree of scopes must have a depth greater than 2 (see commit diff for rootScopeSpec.js).

Component(s): scope

Impact: small

Complexity: small

This issue is related to:

**Detailed Description:**

In the $broadcast method, the `event.currentScope` is initialized with `current` which is the iterator used by the scope traversal's loop.

It caused problems when using asynchonously the event object : the `event.currentScope` is not the scope which listen the event. It's the last scope crossed by the traversal which has nothing to do with the event (or coincidentally has).

**Other Comments:**