fix(ivy): proper slot allocation for pure functions in hostBindings function (#27587)

Prior to this update, we always returned the number of host vars defined in @Component definition as a value for `allocatePureFunctionsSlot` callback in ValueConverter. As a result, pure function arguments were not accounted for, thus leasing to incorrect slot offsets in `pureFunction` calls. Now we update and return total # of host vars, so the offsets are defined correctly.

PR Close #27587
This commit is contained in:
Andrew Kushnir
2018-12-10 14:53:10 -08:00
committed by Alex Rickabaugh
parent 3cb6dad6d5
commit ceb14deb60
2 changed files with 80 additions and 2 deletions

View File

@ -666,11 +666,11 @@ function createHostBindingsFunction(
return convertPropertyBinding(
null, implicit, value, 'b', BindingForm.TrySimple, () => error('Unexpected interpolation'));
};
if (bindings) {
const hostVarsCountFn = (numSlots: number): number => {
const originalVarsCount = totalHostVarsCount;
totalHostVarsCount += numSlots;
return hostVarsCount;
return originalVarsCount;
};
const valueConverter = new ValueConverter(
constantPool,