fix(change_detect): Sort DirectiveMetadata
properties during processing
The Angular 2 render compiler can get out of sync between its transformer execution and its runtime execution, leading to incorrect change detectors with out-of-order property values. Stable sorting solves this problem (temporarily).
This commit is contained in:
@ -645,13 +645,13 @@ export function main() {
|
||||
|
||||
var input = rootTC.query(By.css("input")).nativeElement;
|
||||
expect(DOM.classList(input))
|
||||
.toEqual(['ng-binding', 'ng-untouched', 'ng-pristine', 'ng-invalid']);
|
||||
.toEqual(['ng-binding', 'ng-invalid', 'ng-pristine', 'ng-untouched']);
|
||||
|
||||
dispatchEvent(input, "blur");
|
||||
rootTC.detectChanges();
|
||||
|
||||
expect(DOM.classList(input))
|
||||
.toEqual(["ng-binding", "ng-pristine", "ng-invalid", "ng-touched"]);
|
||||
.toEqual(["ng-binding", "ng-invalid", "ng-pristine", "ng-touched"]);
|
||||
|
||||
input.value = "updatedValue";
|
||||
dispatchEvent(input, "change");
|
||||
@ -675,13 +675,13 @@ export function main() {
|
||||
|
||||
var input = rootTC.query(By.css("input")).nativeElement;
|
||||
expect(DOM.classList(input))
|
||||
.toEqual(["ng-binding", "ng-untouched", "ng-pristine", "ng-invalid"]);
|
||||
.toEqual(["ng-binding", "ng-invalid", "ng-pristine", "ng-untouched"]);
|
||||
|
||||
dispatchEvent(input, "blur");
|
||||
rootTC.detectChanges();
|
||||
|
||||
expect(DOM.classList(input))
|
||||
.toEqual(["ng-binding", "ng-pristine", "ng-invalid", "ng-touched"]);
|
||||
.toEqual(["ng-binding", "ng-invalid", "ng-pristine", "ng-touched"]);
|
||||
|
||||
input.value = "updatedValue";
|
||||
dispatchEvent(input, "change");
|
||||
@ -703,13 +703,13 @@ export function main() {
|
||||
|
||||
var input = rootTC.query(By.css("input")).nativeElement;
|
||||
expect(DOM.classList(input))
|
||||
.toEqual(["ng-binding", "ng-untouched", "ng-pristine", "ng-invalid"]);
|
||||
.toEqual(["ng-binding", "ng-invalid", "ng-pristine", "ng-untouched"]);
|
||||
|
||||
dispatchEvent(input, "blur");
|
||||
rootTC.detectChanges();
|
||||
|
||||
expect(DOM.classList(input))
|
||||
.toEqual(["ng-binding", "ng-pristine", "ng-invalid", "ng-touched"]);
|
||||
.toEqual(["ng-binding", "ng-invalid", "ng-pristine", "ng-touched"]);
|
||||
|
||||
input.value = "updatedValue";
|
||||
dispatchEvent(input, "change");
|
||||
|
Reference in New Issue
Block a user