diff --git a/modules/angular2/src/core/change_detection/codegen_logic_util.ts b/modules/angular2/src/core/change_detection/codegen_logic_util.ts index 2c2e2ab741a0..d1d27a6c7332 100644 --- a/modules/angular2/src/core/change_detection/codegen_logic_util.ts +++ b/modules/angular2/src/core/change_detection/codegen_logic_util.ts @@ -103,7 +103,7 @@ export class CodegenLogicUtil { break; case RecordType.Chain: - rhs = 'null'; + rhs = `${getLocalName(protoRec.args[protoRec.args.length - 1])}`; break; default: diff --git a/modules/angular2/test/core/change_detection/change_detector_config.ts b/modules/angular2/test/core/change_detection/change_detector_config.ts index ed7493306433..c770c004972f 100644 --- a/modules/angular2/test/core/change_detection/change_detector_config.ts +++ b/modules/angular2/test/core/change_detection/change_detector_config.ts @@ -433,6 +433,7 @@ var _availableEventDefinitions = [ '(event)="a[0]=\$event"', // '(event)="\$event=1"', '(event)="a=a+1; a=a+1;"', + '(event)="true; false"', '(event)="false"', '(event)="true"', '(event)="true ? a = a + 1 : a = a + 1"', diff --git a/modules/angular2/test/core/change_detection/change_detector_spec.ts b/modules/angular2/test/core/change_detection/change_detector_spec.ts index 80a9cb3cb621..ba34c3a5b1f6 100644 --- a/modules/angular2/test/core/change_detection/change_detector_spec.ts +++ b/modules/angular2/test/core/change_detection/change_detector_spec.ts @@ -1341,12 +1341,16 @@ export function main() { it('should return the prevent default value', () => { var val = _createChangeDetector('(event)="false"', d, null); - var res = val.changeDetector.handleEvent("event", 0, locals); - expect(res).toBe(true); + var preventDefault = val.changeDetector.handleEvent("event", 0, locals); + expect(preventDefault).toBe(true); val = _createChangeDetector('(event)="true"', d, null); - res = val.changeDetector.handleEvent("event", 0, locals); - expect(res).toBe(false); + preventDefault = val.changeDetector.handleEvent("event", 0, locals); + expect(preventDefault).toBe(false); + + val = _createChangeDetector('(event)="true; false"', d, null); + preventDefault = val.changeDetector.handleEvent("event", 0, locals); + expect(preventDefault).toEqual(true); }); it('should support short-circuiting', () => {