chore(typescript): fixes dart failures and linter

Closes #4359
This commit is contained in:
vsavkin
2015-09-25 12:58:00 -07:00
committed by Victor Savkin
parent 7a53f82516
commit 5bf6a3af15
21 changed files with 293 additions and 178 deletions

View File

@ -216,7 +216,7 @@ export class AbstractChangeDetector<T> implements ChangeDetector {
}
// This is an experimental feature. Works only in Dart.
protected observeValue(value: any, index: number): any {
observeValue(value: any, index: number): any {
if (isObservable(value)) {
this._createArrayToStoreObservables();
if (isBlank(this.subscriptions[index])) {
@ -232,7 +232,7 @@ export class AbstractChangeDetector<T> implements ChangeDetector {
}
// This is an experimental feature. Works only in Dart.
protected observeDirective(value: any, index: number): any {
observeDirective(value: any, index: number): any {
if (isObservable(value)) {
this._createArrayToStoreObservables();
var arrayIndex = this.numberOfPropertyProtoRecords + index + 2; // +1 is component
@ -243,7 +243,7 @@ export class AbstractChangeDetector<T> implements ChangeDetector {
}
// This is an experimental feature. Works only in Dart.
protected observeComponent(value: any): any {
observeComponent(value: any): any {
if (isObservable(value)) {
this._createArrayToStoreObservables();
var index = this.numberOfPropertyProtoRecords + 1;
@ -262,24 +262,23 @@ export class AbstractChangeDetector<T> implements ChangeDetector {
}
}
protected getDirectiveFor(directives: any, index: number): any {
getDirectiveFor(directives: any, index: number): any {
return directives.getDirectiveFor(this.directiveIndices[index]);
}
protected getDetectorFor(directives: any, index: number): ChangeDetector {
getDetectorFor(directives: any, index: number): ChangeDetector {
return directives.getDetectorFor(this.directiveIndices[index]);
}
protected notifyDispatcher(value: any): void {
notifyDispatcher(value: any): void {
this.dispatcher.notifyOnBinding(this._currentBinding(), value);
}
protected logBindingUpdate(value: any): void {
logBindingUpdate(value: any): void {
this.dispatcher.logBindingUpdate(this._currentBinding(), value);
}
protected addChange(changes: StringMap<string, any>, oldValue: any,
newValue: any): StringMap<string, any> {
addChange(changes: StringMap<string, any>, oldValue: any, newValue: any): StringMap<string, any> {
if (isBlank(changes)) {
changes = {};
}
@ -295,12 +294,12 @@ export class AbstractChangeDetector<T> implements ChangeDetector {
throw new ChangeDetectionError(this._currentBinding().debug, exception, stack, context);
}
protected throwOnChangeError(oldValue: any, newValue: any): void {
throwOnChangeError(oldValue: any, newValue: any): void {
throw new ExpressionChangedAfterItHasBeenCheckedException(this._currentBinding().debug,
oldValue, newValue, null);
}
protected throwDehydratedError(): void { throw new DehydratedException(); }
throwDehydratedError(): void { throw new DehydratedException(); }
private _currentBinding(): BindingTarget {
return this.bindingTargets[this.propertyBindingIndex];

View File

@ -77,7 +77,7 @@ export class DirectiveResolver {
}
if (a instanceof HostListenerMetadata) {
var args = isPresent(a.args) ? a.args.join(', ') : '';
var args = isPresent(a.args) ? (<any[]>a.args).join(', ') : '';
host[`(${a.eventName})`] = `${propName}(${args})`;
}

View File

@ -83,7 +83,7 @@ export class ExceptionHandler {
}
_longStackTrace(stackTrace: any): any {
return isListLikeIterable(stackTrace) ? (<any>stackTrace).join("\n\n-----async gap-----\n") :
return isListLikeIterable(stackTrace) ? (<any[]>stackTrace).join("\n\n-----async gap-----\n") :
stackTrace.toString();
}

View File

@ -91,7 +91,7 @@ export class StyleInliner {
}
return PromiseWrapper.all(promises).then(function(cssParts) {
var cssText = cssParts.join('');
var cssText = (<any[]>cssParts).join('');
if (partIndex < parts.length) {
// append then content located after the last @import rule
cssText += parts[partIndex];

View File

@ -5,8 +5,8 @@ import {DOCUMENT} from '../dom_tokens';
@Injectable()
export class SharedStylesHost {
protected _styles: string[] = [];
protected _stylesSet: Set<string> = new Set();
_styles: string[] = [];
_stylesSet: Set<string> = new Set();
constructor() {}
@ -22,7 +22,7 @@ export class SharedStylesHost {
this.onStylesAdded(additions);
}
protected onStylesAdded(additions: string[]) {}
onStylesAdded(additions: string[]) {}
getAllStyles(): string[] { return this._styles; }
}