From f3e0cc89ed87d7646951fc7929cb201f483c5f61 Mon Sep 17 00:00:00 2001 From: Pawel Kozlowski Date: Fri, 22 Mar 2019 16:41:27 +0100 Subject: [PATCH] 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 --- packages/core/src/render3/bindings.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/render3/bindings.ts b/packages/core/src/render3/bindings.ts index c3a105ae3b..400aec275e 100644 --- a/packages/core/src/render3/bindings.ts +++ b/packages/core/src/render3/bindings.ts @@ -25,7 +25,7 @@ export function updateBinding(lView: LView, bindingIndex: number, value: any): a /** Gets the current binding value. */ export function getBinding(lView: LView, bindingIndex: number): any { - ngDevMode && assertDataInRange(lView, lView[bindingIndex]); + ngDevMode && assertDataInRange(lView, bindingIndex); ngDevMode && assertNotEqual(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.'); return lView[bindingIndex];