refactor: add leading underscore to private fields

Closes #4001
This commit is contained in:
Harry Terkelsen
2015-09-04 15:09:02 -07:00
committed by Harry Terkelsen
parent c320240086
commit d8c5ab232c
16 changed files with 150 additions and 138 deletions

View File

@ -49,8 +49,8 @@ export function main() {
@Directive({selector: '[lifecycle-dir]', lifecycle: [LifecycleEvent.DoCheck]})
class LifecycleDir {
constructor(private log: Log) {}
doCheck() { this.log.add("child_doCheck"); }
constructor(private _log: Log) {}
doCheck() { this._log.add("child_doCheck"); }
}
@Component({
@ -69,21 +69,21 @@ class LifecycleDir {
@View({template: `<div lifecycle-dir></div>`, directives: [LifecycleDir]})
class LifecycleCmp {
field;
constructor(private log: Log) {}
constructor(private _log: Log) {}
onChanges(_) { this.log.add("onChanges"); }
onChanges(_) { this._log.add("onChanges"); }
onInit() { this.log.add("onInit"); }
onInit() { this._log.add("onInit"); }
doCheck() { this.log.add("doCheck"); }
doCheck() { this._log.add("doCheck"); }
afterContentInit() { this.log.add("afterContentInit"); }
afterContentInit() { this._log.add("afterContentInit"); }
afterContentChecked() { this.log.add("afterContentChecked"); }
afterContentChecked() { this._log.add("afterContentChecked"); }
afterViewInit() { this.log.add("afterViewInit"); }
afterViewInit() { this._log.add("afterViewInit"); }
afterViewChecked() { this.log.add("afterViewChecked"); }
afterViewChecked() { this._log.add("afterViewChecked"); }
}
@Component({selector: 'my-comp'})

View File

@ -217,16 +217,16 @@ export function main() {
}
export class MockStep implements CompileStep {
constructor(private processElementClosure: Function,
private processStyleClosure: Function = null) {}
constructor(private _processElementClosure: Function,
private _processStyleClosure: Function = null) {}
processElement(parent: CompileElement, current: CompileElement, control: CompileControl) {
if (isPresent(this.processElementClosure)) {
this.processElementClosure(parent, current, control);
if (isPresent(this._processElementClosure)) {
this._processElementClosure(parent, current, control);
}
}
processStyle(style: string): string {
if (isPresent(this.processStyleClosure)) {
return this.processStyleClosure(style);
if (isPresent(this._processStyleClosure)) {
return this._processStyleClosure(style);
} else {
return style;
}