This reverts commit 7f8c2225f2
.
This commit caused test failures internally, which were traced back to the
optimizer removing NgModuleFactory constructor calls when those calls caused
side-effectful registration of NgModules by their ids.
PR Close #38303
This commit is contained in:
@ -103,5 +103,3 @@ export interface QueryList<T>/* implements Iterable<T> */ {
|
||||
export type NgIterable<T> = Array<T>|Iterable<T>;
|
||||
|
||||
export class NgZone {}
|
||||
|
||||
export declare function ɵnoSideEffects<T>(fn: () => T): T;
|
||||
|
@ -3538,9 +3538,7 @@ runInEachFileSystem(os => {
|
||||
expect(factoryContents).toContain(`import * as i0 from '@angular/core';`);
|
||||
expect(factoryContents).toContain(`import { NotAModule, TestModule } from './test';`);
|
||||
expect(factoryContents)
|
||||
.toContain(
|
||||
'export var TestModuleNgFactory = ' +
|
||||
'i0.ɵnoSideEffects(function () { return new i0.\u0275NgModuleFactory(TestModule); });');
|
||||
.toContain(`export var TestModuleNgFactory = new i0.\u0275NgModuleFactory(TestModule);`);
|
||||
expect(factoryContents).not.toContain(`NotAModuleNgFactory`);
|
||||
expect(factoryContents).not.toContain('\u0275NonEmptyModule');
|
||||
|
||||
@ -3679,14 +3677,11 @@ runInEachFileSystem(os => {
|
||||
env.driveMain();
|
||||
|
||||
const factoryContents = env.getContents('test.ngfactory.js');
|
||||
expect(normalize(factoryContents))
|
||||
.toBe(
|
||||
'import * as i0 from "./r3_symbols"; ' +
|
||||
'import { TestModule } from \'./test\'; ' +
|
||||
'export var TestModuleNgFactory = ' +
|
||||
'i0.\u0275noSideEffects(function () { ' +
|
||||
'return new i0.NgModuleFactory(TestModule); ' +
|
||||
'});');
|
||||
expect(normalize(factoryContents)).toBe(normalize(`
|
||||
import * as i0 from "./r3_symbols";
|
||||
import { TestModule } from './test';
|
||||
export var TestModuleNgFactory = new i0.NgModuleFactory(TestModule);
|
||||
`));
|
||||
});
|
||||
|
||||
describe('file-level comments', () => {
|
||||
|
Reference in New Issue
Block a user