
committed by
Igor Minar

parent
f48b343af1
commit
0f5c70d563
@ -68,4 +68,4 @@ export default {
|
||||
},
|
||||
banner: banner,
|
||||
plugins: [{resolveId: resolve}, commonjs()]
|
||||
}
|
||||
};
|
||||
|
@ -6,7 +6,6 @@
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
/* tslint:disable:no-console */
|
||||
|
||||
// Must be imported first, because Angular decorators throw on load.
|
||||
import 'reflect-metadata';
|
||||
@ -18,6 +17,7 @@ import {__NGTOOLS_PRIVATE_API_2, readConfiguration} from '@angular/compiler-cli'
|
||||
|
||||
const glob = require('glob');
|
||||
|
||||
/* tslint:disable:no-console */
|
||||
/**
|
||||
* Main method.
|
||||
* Standalone program that executes codegen using the ngtools API and tests that files were
|
||||
|
@ -6,7 +6,6 @@
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
/* tslint:disable:no-console */
|
||||
|
||||
// Must be imported first, because Angular decorators throw on load.
|
||||
import 'reflect-metadata';
|
||||
@ -16,6 +15,7 @@ import * as ts from 'typescript';
|
||||
import * as assert from 'assert';
|
||||
import {CompilerOptions, CodeGenerator, CompilerHostContext, NodeCompilerHostContext, readConfiguration} from '@angular/compiler-cli';
|
||||
|
||||
/* tslint:disable:no-console */
|
||||
/**
|
||||
* Main method.
|
||||
* Standalone program that executes the real codegen and tests that
|
||||
|
@ -329,7 +329,7 @@ export class CompilerHost extends BaseAotCompilerHost<CompilerHostContext> {
|
||||
this.moduleFileNames.set(key, result);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* We want a moduleId that will appear in import statements in the generated code.
|
||||
@ -401,7 +401,7 @@ export class CompilerHost extends BaseAotCompilerHost<CompilerHostContext> {
|
||||
private rewriteGenDirPath(filepath: string) {
|
||||
const nodeModulesIndex = filepath.indexOf(NODE_MODULES);
|
||||
if (nodeModulesIndex !== -1) {
|
||||
// If we are in node_modulse, transplant them into `genDir`.
|
||||
// If we are in node_modules, transplant them into `genDir`.
|
||||
return path.join(this.genDir, filepath.substring(nodeModulesIndex));
|
||||
} else {
|
||||
// pretend that containing file is on top of the `genDir` to normalize the paths.
|
||||
|
@ -401,7 +401,7 @@ export class TsCompilerAotCompilerTypeCheckHostAdapter extends
|
||||
|
||||
readFile = (fileName: string) => this.context.readFile(fileName);
|
||||
getDefaultLibFileName = (options: ts.CompilerOptions) =>
|
||||
this.context.getDefaultLibFileName(options);
|
||||
this.context.getDefaultLibFileName(options)
|
||||
getCurrentDirectory = () => this.context.getCurrentDirectory();
|
||||
getCanonicalFileName = (fileName: string) => this.context.getCanonicalFileName(fileName);
|
||||
useCaseSensitiveFileNames = () => this.context.useCaseSensitiveFileNames();
|
||||
|
@ -317,7 +317,6 @@ class _NodeEmitterVisitor implements StatementVisitor, ExpressionVisitor {
|
||||
ts.createConditional(
|
||||
expr.condition.visitExpression(this, null), expr.trueCase.visitExpression(this, null),
|
||||
expr.falseCase !.visitExpression(this, null)));
|
||||
;
|
||||
}
|
||||
|
||||
visitNotExpr(expr: NotExpr): RecordedNode<ts.PrefixUnaryExpression> {
|
||||
|
@ -131,7 +131,7 @@ class MockWatchHost {
|
||||
|
||||
reportDiagnostics(diags: ng.Diagnostics) { this.diagnostics.push(...diags); }
|
||||
readConfiguration() { return this.config; }
|
||||
createCompilerHost(options: ng.CompilerOptions) { return ng.createCompilerHost({options}); };
|
||||
createCompilerHost(options: ng.CompilerOptions) { return ng.createCompilerHost({options}); }
|
||||
createEmitCallback() { return undefined; }
|
||||
onFileChange(
|
||||
options: ng.CompilerOptions, listener: (event: FileChangeEvent, fileName: string) => void,
|
||||
|
@ -165,7 +165,7 @@ function convert(annotatedSource: string) {
|
||||
}
|
||||
}, undefined, undefined, transformers);
|
||||
return normalizeResult(result);
|
||||
};
|
||||
}
|
||||
|
||||
function findNode(node: ts.Node, start: number, length: number): ts.Node|undefined {
|
||||
function find(node: ts.Node): ts.Node|undefined {
|
||||
|
Reference in New Issue
Block a user