fix(zone.js): browser-legacy should not reference Zone (#32016)

PR Close #32016
This commit is contained in:
JiaLiPassion
2019-08-06 09:54:54 +09:00
committed by Kara Erickson
parent 48487cb70e
commit a91a55a6d2
4 changed files with 25 additions and 11 deletions

View File

@ -10,15 +10,20 @@
* @suppress {missingRequire}
*/
import {propertyPatch} from './define-property';
import {_redefineProperty, propertyPatch} from './define-property';
import {eventTargetLegacyPatch} from './event-target-legacy';
import {propertyDescriptorLegacyPatch} from './property-descriptor-legacy';
import {registerElementPatch} from './register-element';
(function(_global: any) {
_global[Zone.__symbol__('legacyPatch')] = function() {
const symbolPrefix = _global['__Zone_symbol_prefix'] || '__zone_symbol__';
function __symbol__(name: string) { return symbolPrefix + name; }
_global[__symbol__('legacyPatch')] = function() {
const Zone = _global['Zone'];
Zone.__load_patch('defineProperty', () => { propertyPatch(); });
Zone.__load_patch('defineProperty', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
api._redefineProperty = _redefineProperty;
propertyPatch();
});
Zone.__load_patch('registerElement', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
registerElementPatch(global, api);
});