This reverts commit 7e9d5f5e826ee80b60d6f6e6e5d17dc94cb491c3. The changes to the case-sensitivity handling in #36968 caused multiple projects to fail to build. See #36992, #36993 and #37000. The issue is related to the logical path handling. But it is felt that it is safer to revert the entire PR and then to investigate further. PR Close #37003
This commit is contained in:
parent
bf446cb2d5
commit
6cce05e2c5
@ -486,8 +486,7 @@ export class NgCompiler {
|
|||||||
// Execute the typeCheck phase of each decorator in the program.
|
// Execute the typeCheck phase of each decorator in the program.
|
||||||
const prepSpan = this.perfRecorder.start('typeCheckPrep');
|
const prepSpan = this.perfRecorder.start('typeCheckPrep');
|
||||||
const ctx = new TypeCheckContext(
|
const ctx = new TypeCheckContext(
|
||||||
typeCheckingConfig, host, compilation.refEmitter!, compilation.reflector,
|
typeCheckingConfig, compilation.refEmitter!, compilation.reflector, host.typeCheckFile);
|
||||||
host.typeCheckFile);
|
|
||||||
compilation.traitCompiler.typeCheck(ctx);
|
compilation.traitCompiler.typeCheck(ctx);
|
||||||
this.perfRecorder.stop(prepSpan);
|
this.perfRecorder.stop(prepSpan);
|
||||||
|
|
||||||
|
@ -38,11 +38,9 @@ export class TypeCheckContext {
|
|||||||
private typeCheckFile: TypeCheckFile;
|
private typeCheckFile: TypeCheckFile;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private config: TypeCheckingConfig, compilerHost: ts.CompilerHost,
|
private config: TypeCheckingConfig, private refEmitter: ReferenceEmitter,
|
||||||
private refEmitter: ReferenceEmitter, private reflector: ReflectionHost,
|
private reflector: ReflectionHost, typeCheckFilePath: AbsoluteFsPath) {
|
||||||
typeCheckFilePath: AbsoluteFsPath) {
|
this.typeCheckFile = new TypeCheckFile(typeCheckFilePath, config, refEmitter, reflector);
|
||||||
this.typeCheckFile =
|
|
||||||
new TypeCheckFile(typeCheckFilePath, config, refEmitter, reflector, compilerHost);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -33,12 +33,11 @@ export class TypeCheckFile extends Environment {
|
|||||||
private tcbStatements: ts.Statement[] = [];
|
private tcbStatements: ts.Statement[] = [];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
readonly fileName: AbsoluteFsPath, config: TypeCheckingConfig, refEmitter: ReferenceEmitter,
|
private fileName: string, config: TypeCheckingConfig, refEmitter: ReferenceEmitter,
|
||||||
reflector: ReflectionHost, compilerHost: ts.CompilerHost) {
|
reflector: ReflectionHost) {
|
||||||
super(
|
super(
|
||||||
config, new ImportManager(new NoopImportRewriter(), 'i'), refEmitter, reflector,
|
config, new ImportManager(new NoopImportRewriter(), 'i'), refEmitter, reflector,
|
||||||
ts.createSourceFile(
|
ts.createSourceFile(fileName, '', ts.ScriptTarget.Latest, true));
|
||||||
compilerHost.getCanonicalFileName(fileName), '', ts.ScriptTarget.Latest, true));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
addTypeCheckBlock(
|
addTypeCheckBlock(
|
||||||
@ -50,7 +49,7 @@ export class TypeCheckFile extends Environment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render(): ts.SourceFile {
|
render(): ts.SourceFile {
|
||||||
let source: string = this.importManager.getAllImports(this.contextFile.fileName)
|
let source: string = this.importManager.getAllImports(this.fileName)
|
||||||
.map(i => `import * as ${i.qualifier} from '${i.specifier}';`)
|
.map(i => `import * as ${i.qualifier} from '${i.specifier}';`)
|
||||||
.join('\n') +
|
.join('\n') +
|
||||||
'\n\n';
|
'\n\n';
|
||||||
@ -76,7 +75,7 @@ export class TypeCheckFile extends Environment {
|
|||||||
source += '\nexport const IS_A_MODULE = true;\n';
|
source += '\nexport const IS_A_MODULE = true;\n';
|
||||||
|
|
||||||
return ts.createSourceFile(
|
return ts.createSourceFile(
|
||||||
this.contextFile.fileName, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
this.fileName, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
||||||
}
|
}
|
||||||
|
|
||||||
getPreludeStatements(): ts.Statement[] {
|
getPreludeStatements(): ts.Statement[] {
|
||||||
|
@ -262,7 +262,7 @@ export function typecheck(
|
|||||||
new LogicalProjectStrategy(reflectionHost, logicalFs),
|
new LogicalProjectStrategy(reflectionHost, logicalFs),
|
||||||
]);
|
]);
|
||||||
const ctx = new TypeCheckContext(
|
const ctx = new TypeCheckContext(
|
||||||
{...ALL_ENABLED_CONFIG, ...config}, host, emitter, reflectionHost, typeCheckFilePath);
|
{...ALL_ENABLED_CONFIG, ...config}, emitter, reflectionHost, typeCheckFilePath);
|
||||||
|
|
||||||
const templateUrl = 'synthetic.html';
|
const templateUrl = 'synthetic.html';
|
||||||
const templateFile = new ParseSourceFile(template, templateUrl);
|
const templateFile = new ParseSourceFile(template, templateUrl);
|
||||||
|
@ -45,7 +45,7 @@ runInEachFileSystem(() => {
|
|||||||
const host = new NgtscCompilerHost(getFileSystem());
|
const host = new NgtscCompilerHost(getFileSystem());
|
||||||
const file = new TypeCheckFile(
|
const file = new TypeCheckFile(
|
||||||
_('/_typecheck_.ts'), ALL_ENABLED_CONFIG, new ReferenceEmitter([]),
|
_('/_typecheck_.ts'), ALL_ENABLED_CONFIG, new ReferenceEmitter([]),
|
||||||
/* reflector */ null!, host);
|
/* reflector */ null!);
|
||||||
const sf = file.render();
|
const sf = file.render();
|
||||||
expect(sf.statements.length).toBe(1);
|
expect(sf.statements.length).toBe(1);
|
||||||
});
|
});
|
||||||
@ -75,8 +75,8 @@ TestClass.ngTypeCtor({value: 'test'});
|
|||||||
new AbsoluteModuleStrategy(program, checker, moduleResolver, reflectionHost),
|
new AbsoluteModuleStrategy(program, checker, moduleResolver, reflectionHost),
|
||||||
new LogicalProjectStrategy(reflectionHost, logicalFs),
|
new LogicalProjectStrategy(reflectionHost, logicalFs),
|
||||||
]);
|
]);
|
||||||
const ctx = new TypeCheckContext(
|
const ctx =
|
||||||
ALL_ENABLED_CONFIG, host, emitter, reflectionHost, _('/_typecheck_.ts'));
|
new TypeCheckContext(ALL_ENABLED_CONFIG, emitter, reflectionHost, _('/_typecheck_.ts'));
|
||||||
const TestClass =
|
const TestClass =
|
||||||
getDeclaration(program, _('/main.ts'), 'TestClass', isNamedClassDeclaration);
|
getDeclaration(program, _('/main.ts'), 'TestClass', isNamedClassDeclaration);
|
||||||
ctx.addInlineTypeCtor(
|
ctx.addInlineTypeCtor(
|
||||||
@ -111,8 +111,8 @@ TestClass.ngTypeCtor({value: 'test'});
|
|||||||
new AbsoluteModuleStrategy(program, checker, moduleResolver, reflectionHost),
|
new AbsoluteModuleStrategy(program, checker, moduleResolver, reflectionHost),
|
||||||
new LogicalProjectStrategy(reflectionHost, logicalFs),
|
new LogicalProjectStrategy(reflectionHost, logicalFs),
|
||||||
]);
|
]);
|
||||||
const ctx = new TypeCheckContext(
|
const ctx =
|
||||||
ALL_ENABLED_CONFIG, host, emitter, reflectionHost, _('/_typecheck_.ts'));
|
new TypeCheckContext(ALL_ENABLED_CONFIG, emitter, reflectionHost, _('/_typecheck_.ts'));
|
||||||
const TestClass =
|
const TestClass =
|
||||||
getDeclaration(program, _('/main.ts'), 'TestClass', isNamedClassDeclaration);
|
getDeclaration(program, _('/main.ts'), 'TestClass', isNamedClassDeclaration);
|
||||||
ctx.addInlineTypeCtor(
|
ctx.addInlineTypeCtor(
|
||||||
@ -153,8 +153,8 @@ TestClass.ngTypeCtor({value: 'test'});
|
|||||||
new AbsoluteModuleStrategy(program, checker, moduleResolver, reflectionHost),
|
new AbsoluteModuleStrategy(program, checker, moduleResolver, reflectionHost),
|
||||||
new LogicalProjectStrategy(reflectionHost, logicalFs),
|
new LogicalProjectStrategy(reflectionHost, logicalFs),
|
||||||
]);
|
]);
|
||||||
const ctx = new TypeCheckContext(
|
const ctx =
|
||||||
ALL_ENABLED_CONFIG, host, emitter, reflectionHost, _('/_typecheck_.ts'));
|
new TypeCheckContext(ALL_ENABLED_CONFIG, emitter, reflectionHost, _('/_typecheck_.ts'));
|
||||||
const TestClass =
|
const TestClass =
|
||||||
getDeclaration(program, _('/main.ts'), 'TestClass', isNamedClassDeclaration);
|
getDeclaration(program, _('/main.ts'), 'TestClass', isNamedClassDeclaration);
|
||||||
ctx.addInlineTypeCtor(
|
ctx.addInlineTypeCtor(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user