angular/angular.js — pull request #4421 by buunguyen (2013-10-15 03:36:12+00:00)
Title: fix($compile): fix missing error handling when new-scope directive is applied before isolated-scope directive

Given `dirA`, which requests new scope, and `dirB`, which requests new & isolated scope. If `dirA` is applied *after* `dirB`, `$compile` reports an error ('Multiple directives [dirB, dirA] asking for new/isolated scope'), which is expected. However, if `dirA` is applied *before* `dirB`, e.g. because `dirA` has higher priority, then no error is thrown and `dirA` shares the isolated scope created for `dirB`. This is inconsistent and can break `dirA`, which might need to access to parent scope's members. This fix addresses this situation by throwing error regardless of order of directive application.

Closes #4402