fix(ivy): properly check LView array size in binding asserts (#29476)

This fix corrects a bug where we were passing a binding _value_
in place of an expected binding index. This reulted in the binding
value being compared to an array length and buggy type coercion.

Fixing this bug speeds up test scenario by ~10-15%.

PR Close #29476
This commit is contained in:
Pawel Kozlowski 2019-03-22 16:41:27 +01:00 committed by Miško Hevery
parent cfa6e8e008
commit f3e0cc89ed
1 changed files with 1 additions and 1 deletions

View File

@ -25,7 +25,7 @@ export function updateBinding(lView: LView, bindingIndex: number, value: any): a
/** Gets the current binding value. */ /** Gets the current binding value. */
export function getBinding(lView: LView, bindingIndex: number): any { export function getBinding(lView: LView, bindingIndex: number): any {
ngDevMode && assertDataInRange(lView, lView[bindingIndex]); ngDevMode && assertDataInRange(lView, bindingIndex);
ngDevMode && ngDevMode &&
assertNotEqual(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.'); assertNotEqual(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');
return lView[bindingIndex]; return lView[bindingIndex];