feat: adjust formatting for clang-format v1.0.19.

This commit is contained in:
Martin Probst
2015-06-12 07:50:45 -07:00
parent 1c2abbc61d
commit a6e7123995
50 changed files with 363 additions and 350 deletions

View File

@ -45,9 +45,9 @@ function _selfRecord(r: ProtoRecord, contextIndex: number, selfIndex: number): P
function _findMatching(r: ProtoRecord, rs: List<ProtoRecord>) {
return ListWrapper.find(rs, (rr) => rr.mode !== RecordType.DIRECTIVE_LIFECYCLE &&
rr.mode === r.mode && rr.funcOrValue === r.funcOrValue &&
rr.contextIndex === r.contextIndex &&
ListWrapper.equals(rr.args, r.args));
rr.mode === r.mode && rr.funcOrValue === r.funcOrValue &&
rr.contextIndex === r.contextIndex &&
ListWrapper.equals(rr.args, r.args));
}
function _replaceIndices(r: ProtoRecord, selfIndex: number, indexMap: Map<any, any>) {

View File

@ -3,8 +3,20 @@ import {BindingRecord} from './binding_record';
import {DirectiveIndex} from './directive_record';
export enum RecordType {
SELF, CONST, PRIMITIVE_OP, PROPERTY, LOCAL, INVOKE_METHOD, INVOKE_CLOSURE, KEYED_ACCESS, PIPE,
BINDING_PIPE, INTERPOLATE, SAFE_PROPERTY, SAFE_INVOKE_METHOD, DIRECTIVE_LIFECYCLE
SELF,
CONST,
PRIMITIVE_OP,
PROPERTY,
LOCAL,
INVOKE_METHOD,
INVOKE_CLOSURE,
KEYED_ACCESS,
PIPE,
BINDING_PIPE,
INTERPOLATE,
SAFE_PROPERTY,
SAFE_INVOKE_METHOD,
DIRECTIVE_LIFECYCLE
}
export class ProtoRecord {

View File

@ -101,7 +101,7 @@ function _injectorBindings(appComponentType): List<Type | Binding | List<any>> {
[NgZone]),
bind(ShadowDomStrategy)
.toFactory((styleUrlResolver, doc) =>
new EmulatedUnscopedShadowDomStrategy(styleUrlResolver, doc.head),
new EmulatedUnscopedShadowDomStrategy(styleUrlResolver, doc.head),
[StyleUrlResolver, DOCUMENT_TOKEN]),
DomRenderer,
DefaultDomCompiler,

View File

@ -348,15 +348,18 @@ function _createProtoElementInjector(binderIndex, parentPeiWithDistance, renderE
}
function _createElementBinder(protoView, boundElementIndex, renderElementBinder,
protoElementInjector, componentDirectiveBinding, directiveBindings): ElementBinder {
protoElementInjector, componentDirectiveBinding,
directiveBindings): ElementBinder {
var parent = null;
if (renderElementBinder.parentIndex !== -1) {
parent = protoView.elementBinders[renderElementBinder.parentIndex];
}
var directiveVariableBindings = createDirectiveVariableBindings(renderElementBinder, directiveBindings);
var elBinder = protoView.bindElement(parent, renderElementBinder.distanceToParent,
protoElementInjector, directiveVariableBindings, componentDirectiveBinding);
var directiveVariableBindings =
createDirectiveVariableBindings(renderElementBinder, directiveBindings);
var elBinder =
protoView.bindElement(parent, renderElementBinder.distanceToParent, protoElementInjector,
directiveVariableBindings, componentDirectiveBinding);
protoView.bindEvent(renderElementBinder.eventBindings, boundElementIndex, -1);
// variables
// The view's locals needs to have a full set of variable names at construction time
@ -369,8 +372,9 @@ function _createElementBinder(protoView, boundElementIndex, renderElementBinder,
return elBinder;
}
export function createDirectiveVariableBindings(renderElementBinder:renderApi.ElementBinder,
directiveBindings:List<DirectiveBinding>): Map<String, number> {
export function createDirectiveVariableBindings(
renderElementBinder: renderApi.ElementBinder,
directiveBindings: List<DirectiveBinding>): Map<String, number> {
var directiveVariableBindings = MapWrapper.create();
MapWrapper.forEach(renderElementBinder.variableBindings, (templateName, exportAs) => {
var dirIndex = _findDirectiveIndexByExportAs(renderElementBinder, directiveBindings, exportAs);
@ -388,7 +392,8 @@ function _findDirectiveIndexByExportAs(renderElementBinder, directiveBindings, e
if (_directiveExportAs(directive) == exportAs) {
if (isPresent(matchedDirective)) {
throw new BaseException(`More than one directive have exportAs = '${exportAs}'. Directives: [${matchedDirective.displayName}, ${directive.displayName}]`);
throw new BaseException(
`More than one directive have exportAs = '${exportAs}'. Directives: [${matchedDirective.displayName}, ${directive.displayName}]`);
}
matchedDirectiveIndex = i;
@ -403,9 +408,10 @@ function _findDirectiveIndexByExportAs(renderElementBinder, directiveBindings, e
return matchedDirectiveIndex;
}
function _directiveExportAs(directive):string {
function _directiveExportAs(directive): string {
var directiveExportAs = directive.metadata.exportAs;
if (isBlank(directiveExportAs) && directive.metadata.type === renderApi.DirectiveMetadata.COMPONENT_TYPE) {
if (isBlank(directiveExportAs) &&
directive.metadata.type === renderApi.DirectiveMetadata.COMPONENT_TYPE) {
return "$implicit";
} else {
return directiveExportAs;

View File

@ -143,9 +143,7 @@ export class NgZone {
errorHandling = StringMapWrapper.merge(Zone.longStackTraceZone,
{onError: function(e) { ngZone._onError(this, e) }});
} else {
errorHandling = {
onError: function(e) { ngZone._onError(this, e) }
};
errorHandling = {onError: function(e) { ngZone._onError(this, e) }};
}
return zone.fork(errorHandling)

View File

@ -240,7 +240,7 @@ export function normalizeBlank(obj) {
return isBlank(obj) ? null : obj;
}
export function normalizeBool(obj:boolean):boolean {
export function normalizeBool(obj: boolean): boolean {
return isBlank(obj) ? false : obj;
}

View File

@ -1,12 +1,12 @@
export enum RequestModesOpts { Cors, NoCors, SameOrigin };
export enum RequestModesOpts {Cors, NoCors, SameOrigin};
export enum RequestCacheOpts { Default, NoStore, Reload, NoCache, ForceCache, OnlyIfCached };
export enum RequestCacheOpts {Default, NoStore, Reload, NoCache, ForceCache, OnlyIfCached};
export enum RequestCredentialsOpts { Omit, SameOrigin, Include };
export enum RequestCredentialsOpts {Omit, SameOrigin, Include};
export enum RequestMethods { GET, POST, PUT, DELETE, OPTIONS, HEAD };
export enum RequestMethods {GET, POST, PUT, DELETE, OPTIONS, HEAD};
export enum ReadyStates { UNSENT, OPEN, HEADERS_RECEIVED, LOADING, DONE, CANCELLED };
export enum ReadyStates {UNSENT, OPEN, HEADERS_RECEIVED, LOADING, DONE, CANCELLED};
export enum ResponseTypes { Basic, Cors, Default, Error, Opaque }
export enum ResponseTypes {Basic, Cors, Default, Error, Opaque}

View File

@ -39,7 +39,7 @@ export class DomProtoView {
(isPresent(this.element) && DOM.hasClass(this.element, NG_BINDING_CLASS)) ? 1 : 0;
this.boundTextNodeCount =
ListWrapper.reduce(elementBinders, (prevCount: number, elementBinder: ElementBinder) =>
prevCount + elementBinder.textNodeIndices.length,
prevCount + elementBinder.textNodeIndices.length,
0);
this.rootNodeCount =
this.isTemplateElement ? DOM.childNodes(DOM.content(this.element)).length : 1;

View File

@ -86,7 +86,7 @@ function _getAppBindings() {
.toValue(appDoc),
bind(ShadowDomStrategy)
.toFactory((styleUrlResolver, doc) =>
new EmulatedUnscopedShadowDomStrategy(styleUrlResolver, doc.head),
new EmulatedUnscopedShadowDomStrategy(styleUrlResolver, doc.head),
[StyleUrlResolver, DOCUMENT_TOKEN]),
DomRenderer,
DefaultDomCompiler,

View File

@ -11,8 +11,7 @@ import {createTestInjector, FunctionWithParamTokens, inject} from './test_inject
export {inject} from './test_injector';
export function proxy() {
}
export function proxy() {}
var _global: jasmine.GlobalPolluter = <any>(typeof window === 'undefined' ? global : window);

View File

@ -42,7 +42,8 @@ export function el(html: string) {
return DOM.firstChild(DOM.content(DOM.createTemplate(html)));
}
var _RE_SPECIAL_CHARS = ['-', '[', ']', '/', '{', '}', '\\', '(', ')', '*', '+', '?', '.', '^', '$', '|'];
var _RE_SPECIAL_CHARS =
['-', '[', ']', '/', '{', '}', '\\', '(', ')', '*', '+', '?', '.', '^', '$', '|'];
var _ESCAPE_RE = RegExpWrapper.create(`[\\${_RE_SPECIAL_CHARS.join('\\')}]`);
export function containsRegexp(input: string): RegExp {
return RegExpWrapper.create(