fix(upgrade): remove unused version export (#33180)

In some module systems (Closure), it's illegal to mutate an export.
This mutated export isn't used anyway, so we can just remove it.

PR Close #33180
This commit is contained in:
Evan Martin 2019-10-04 10:44:11 -07:00 committed by Matias Niemelä
parent 86104b82b8
commit becd62d4a1
3 changed files with 4 additions and 5 deletions

View File

@ -280,7 +280,6 @@ export function getAngularLib(): any {
*/
export function setAngularJSGlobal(ng: any): void {
angular = ng;
version = ng && ng.version;
}
/**
@ -309,5 +308,3 @@ export const injector: typeof angular.injector =
export const resumeBootstrap: typeof angular.resumeBootstrap = () => angular.resumeBootstrap();
export const getTestability: typeof angular.getTestability = e => angular.getTestability(e);
export let version = angular.version;

View File

@ -29,7 +29,8 @@ withEachNg1Version(() => {
afterEach(() => destroyPlatform());
describe('(basic use)', () => {
it('should have AngularJS loaded', () => expect(angular.version.major).toBe(1));
it('should have AngularJS loaded',
() => expect(angular.getAngularJSGlobal().version.major).toBe(1));
it('should instantiate ng2 in ng1 template and project content', async(() => {
const ng1Module = angular.module_('ng1', []);

View File

@ -23,7 +23,8 @@ withEachNg1Version(() => {
beforeEach(() => destroyPlatform());
afterEach(() => destroyPlatform());
it('should have AngularJS loaded', () => expect(angular.version.major).toBe(1));
it('should have AngularJS loaded',
() => expect(angular.getAngularJSGlobal().version.major).toBe(1));
it('should verify UpgradeAdapter example', async(() => {