chore: clang-format master
This commit is contained in:
@ -8,9 +8,17 @@ import * as path from 'path';
|
||||
import * as compiler from '@angular/compiler';
|
||||
import {ViewEncapsulation} from '@angular/core';
|
||||
import {StaticReflector} from './static_reflector';
|
||||
import {CompileMetadataResolver, HtmlParser, DirectiveNormalizer, Lexer, Parser,
|
||||
TemplateParser, DomElementSchemaRegistry, StyleCompiler,
|
||||
ViewCompiler, TypeScriptEmitter
|
||||
import {
|
||||
CompileMetadataResolver,
|
||||
HtmlParser,
|
||||
DirectiveNormalizer,
|
||||
Lexer,
|
||||
Parser,
|
||||
TemplateParser,
|
||||
DomElementSchemaRegistry,
|
||||
StyleCompiler,
|
||||
ViewCompiler,
|
||||
TypeScriptEmitter
|
||||
} from './compiler_private';
|
||||
|
||||
import {Parse5DomAdapter} from '@angular/platform-server';
|
||||
@ -96,8 +104,7 @@ export class CodeGenerator {
|
||||
let root = this.ngOptions.basePath;
|
||||
for (let eachRootDir of this.options.rootDirs || []) {
|
||||
if (this.ngOptions.trace) {
|
||||
console.log(
|
||||
`Check if ${filePath} is under rootDirs element ${eachRootDir}`);
|
||||
console.log(`Check if ${filePath} is under rootDirs element ${eachRootDir}`);
|
||||
}
|
||||
if (path.relative(eachRootDir, filePath).indexOf('.') !== 0) {
|
||||
root = eachRootDir;
|
||||
@ -170,7 +177,7 @@ export class CodeGenerator {
|
||||
new compiler.DirectiveResolver(staticReflector), new compiler.PipeResolver(staticReflector),
|
||||
new compiler.ViewResolver(staticReflector), null, null, staticReflector);
|
||||
|
||||
return new CodeGenerator(options, ngOptions, program, compilerHost,
|
||||
staticReflector, resolver, offlineCompiler, reflectorHost);
|
||||
return new CodeGenerator(options, ngOptions, program, compilerHost, staticReflector, resolver,
|
||||
offlineCompiler, reflectorHost);
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,8 @@ export type TemplateParser = _c.TemplateParser;
|
||||
export var TemplateParser: typeof _c.TemplateParser = _c.TemplateParser;
|
||||
|
||||
export type DomElementSchemaRegistry = _c.DomElementSchemaRegistry;
|
||||
export var DomElementSchemaRegistry: typeof _c.DomElementSchemaRegistry = _c.DomElementSchemaRegistry;
|
||||
export var DomElementSchemaRegistry: typeof _c.DomElementSchemaRegistry =
|
||||
_c.DomElementSchemaRegistry;
|
||||
|
||||
export type StyleCompiler = _c.StyleCompiler;
|
||||
export var StyleCompiler: typeof _c.StyleCompiler = _c.StyleCompiler;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env node
|
||||
#!/usr/bin / env node
|
||||
|
||||
// Must be imported first, because angular2 decorators throws on load.
|
||||
import 'reflect-metadata';
|
||||
|
@ -125,7 +125,7 @@ export class StaticReflector implements ReflectorReader {
|
||||
let parameterDecorators = <any[]>this.simplify(type, ctor['parameterDecorators']);
|
||||
|
||||
parameters = [];
|
||||
parameterTypes.forEach( (paramType, index) => {
|
||||
parameterTypes.forEach((paramType, index) => {
|
||||
let nestedResult: any[] = [];
|
||||
if (paramType) {
|
||||
nestedResult.push(paramType);
|
||||
@ -152,7 +152,7 @@ export class StaticReflector implements ReflectorReader {
|
||||
private registerDecoratorOrConstructor(type: StaticSymbol, ctor: any): void {
|
||||
this.conversionMap.set(type, (context: StaticSymbol, args: any[]) => {
|
||||
let argValues: any[] = [];
|
||||
args.forEach( (arg, index) => {
|
||||
args.forEach((arg, index) => {
|
||||
let argValue: any;
|
||||
if (typeof arg === 'object' && !arg['__symbolic']) {
|
||||
argValue = mapStringMap(arg, (value, key) => this.simplify(context, value));
|
||||
@ -387,6 +387,6 @@ function mapStringMap(input: {[key: string]: any},
|
||||
return result;
|
||||
}
|
||||
|
||||
function isPrimitive(o: any):boolean {
|
||||
function isPrimitive(o: any): boolean {
|
||||
return o === null || (typeof o !== "function" && typeof o !== "object");
|
||||
}
|
@ -9,7 +9,11 @@ import {
|
||||
import {isBlank} from '@angular/facade/src/lang';
|
||||
import {ListWrapper} from '@angular/facade/src/collection';
|
||||
|
||||
import {StaticReflector, StaticReflectorHost, StaticSymbol} from '@angular/compiler_cli/src/static_reflector';
|
||||
import {
|
||||
StaticReflector,
|
||||
StaticReflectorHost,
|
||||
StaticSymbol
|
||||
} from '@angular/compiler_cli/src/static_reflector';
|
||||
|
||||
describe('StaticReflector', () => {
|
||||
let noContext = new StaticSymbol('', '');
|
||||
|
Reference in New Issue
Block a user