Permalink
Browse files

fix(Let): properly create instruction Id

  • Loading branch information...
bigopon authored and EisenbergEffect committed Oct 26, 2018
1 parent bbdbc43 commit ac3cb2bcf330b5cfc45b294b66d00a1da6fcb360
Showing with 5 additions and 6 deletions.
  1. +2 −6 src/view-compiler.js
  2. +3 −0 test/view-compiler.spec.js
@@ -320,13 +320,9 @@ export class ViewCompiler {
// and the binding language has an implementation for it
// This is an backward compat move
if (tagName === 'let' && !type && bindingLanguage.createLetExpressions !== defaultLetHandler) {
instructions[auTargetID] = TargetInstruction.letElement(
bindingLanguage.createLetExpressions(
resources,
node
)
);
expressions = bindingLanguage.createLetExpressions(resources, node);
auTargetID = makeIntoInstructionTarget(node);
instructions[auTargetID] = TargetInstruction.letElement(expressions);
return node.nextSibling;
}
if (type) {
@@ -184,6 +184,9 @@ describe('ViewCompiler', () => {
expect(Object.keys(instructions).length).toBe(1, 'It should have had 1 instruction with let ce');
let instruction;
for (let id in instructions) {
// ensure instruction ids are valid
// there was a bug in compliation that caused id to be undefined
expect(parseInt(id, 10)).not.toBeNaN();
instruction = instructions[id];
break;
}

0 comments on commit ac3cb2b

Please sign in to comment.