refactor: remove global from facade/lang (#14837)

This commit is contained in:
Miško Hevery
2017-03-01 15:18:10 -08:00
committed by Chuck Jazdzewski
parent b0e0839075
commit 84a65cf788
26 changed files with 88 additions and 123 deletions

View File

@ -6,8 +6,8 @@
* found in the LICENSE file at https://angular.io/license
*/
import {global} from '@angular/common/src/facade/lang';
import {Compiler, SystemJsNgModuleLoader} from '@angular/core';
import {global} from '@angular/core/src/util';
import {async} from '@angular/core/testing';
import {afterEach, beforeEach, describe, expect, it} from '@angular/core/testing/testing_internal';
@ -24,14 +24,14 @@ export function main() {
describe('SystemJsNgModuleLoader', () => {
let oldSystem: any = null;
beforeEach(() => {
oldSystem = (global as any).System;
(global as any).System = mockSystem({
oldSystem = global['System'];
global['System'] = mockSystem({
'test.ngfactory':
{'default': 'test module factory', 'NamedNgFactory': 'test NamedNgFactory'},
'prefixed/test/suffixed': {'NamedNgFactory': 'test module factory'}
});
});
afterEach(() => { (global as any).System = oldSystem; });
afterEach(() => { global['System'] = oldSystem; });
it('loads a default factory by appending the factory suffix', async(() => {
const loader = new SystemJsNgModuleLoader(new Compiler());