fix(core): fix retrieving the binding name when an expression changes (#21814)

fixes #21735
fixes #21788

PR Close #21814
This commit is contained in:
Victor Berchet
2018-01-26 14:36:11 -08:00
committed by Jason Aden
parent dcca799dbb
commit 2af19c96f2
3 changed files with 45 additions and 5 deletions

View File

@ -98,7 +98,7 @@ export function checkBindingNoChanges(
view: ViewData, def: NodeDef, bindingIdx: number, value: any) {
const oldValue = view.oldValues[def.bindingIndex + bindingIdx];
if ((view.state & ViewState.BeforeFirstCheck) || !devModeEqual(oldValue, value)) {
const bindingName = def.bindings[def.bindingIndex].name;
const bindingName = def.bindings[bindingIdx].name;
throw expressionChangedAfterItHasBeenCheckedError(
Services.createDebugContext(view, def.nodeIndex), `${bindingName}: ${oldValue}`,
`${bindingName}: ${value}`, (view.state & ViewState.BeforeFirstCheck) !== 0);