This reverts commit 1882451ec03daeebe32f2355030faf7e2f90ae8a. Reason: breaks some g3 targets. PR Close #35973
This commit is contained in:
parent
15482e7367
commit
71309d223d
@ -43,7 +43,6 @@ Below is the full list of currently supported modules.
|
|||||||
|PromiseRejectionEvent|PromiseRejectEvent will fire when ZoneAwarePromise has unhandled error|__Zone_disable_PromiseRejectionEvent = true|
|
|PromiseRejectionEvent|PromiseRejectEvent will fire when ZoneAwarePromise has unhandled error|__Zone_disable_PromiseRejectionEvent = true|
|
||||||
|mediaQuery|mediaQuery addListener API will be patched as Zone aware EventTask. (By default, mediaQuery patch will not be loaded by zone.js) |__Zone_disable_mediaQuery = true|
|
|mediaQuery|mediaQuery addListener API will be patched as Zone aware EventTask. (By default, mediaQuery patch will not be loaded by zone.js) |__Zone_disable_mediaQuery = true|
|
||||||
|notification|notification onProperties API will be patched as Zone aware EventTask. (By default, notification patch will not be loaded by zone.js) |__Zone_disable_notification = true|
|
|notification|notification onProperties API will be patched as Zone aware EventTask. (By default, notification patch will not be loaded by zone.js) |__Zone_disable_notification = true|
|
||||||
|MessagePort|MessagePort onProperties API will be patched as Zone aware EventTask. (By default, MessagePort patch will not be loaded by zone.js) |__Zone_disable_MessagePort = true|
|
|
||||||
|
|
||||||
- NodeJS
|
- NodeJS
|
||||||
|
|
||||||
|
@ -40,7 +40,6 @@ ES5_BUNDLES = {
|
|||||||
"webapis-shadydom": _DIR + "browser/shadydom",
|
"webapis-shadydom": _DIR + "browser/shadydom",
|
||||||
"zone-patch-socket-io": _DIR + "extra/socket-io",
|
"zone-patch-socket-io": _DIR + "extra/socket-io",
|
||||||
"zone-patch-user-media": _DIR + "browser/webapis-user-media",
|
"zone-patch-user-media": _DIR + "browser/webapis-user-media",
|
||||||
"zone-patch-message-port": _DIR + "browser/message-port",
|
|
||||||
"zone-testing": _DIR + "testing/zone-testing",
|
"zone-testing": _DIR + "testing/zone-testing",
|
||||||
"zone-testing-bundle": _DIR + "browser/rollup-legacy-test-main",
|
"zone-testing-bundle": _DIR + "browser/rollup-legacy-test-main",
|
||||||
}
|
}
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
/**
|
|
||||||
* @license
|
|
||||||
* Copyright Google Inc. All Rights Reserved.
|
|
||||||
*
|
|
||||||
* Use of this source code is governed by an MIT-style license that can be
|
|
||||||
* found in the LICENSE file at https://angular.io/license
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Monkey patch `MessagePort.prototype.onmessage` and `MessagePort.prototype.onmessageerror`
|
|
||||||
* property.
|
|
||||||
*/
|
|
||||||
Zone.__load_patch('MessagePort', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
|
|
||||||
const MessagePort = global['MessagePort'];
|
|
||||||
if (typeof MessagePort !== 'undefined' && MessagePort.prototype) {
|
|
||||||
api.patchOnProperties(MessagePort.prototype, ['message', 'messageerror']);
|
|
||||||
}
|
|
||||||
});
|
|
@ -1,49 +0,0 @@
|
|||||||
/**
|
|
||||||
* @license
|
|
||||||
* Copyright Google Inc. All Rights Reserved.
|
|
||||||
*
|
|
||||||
* Use of this source code is governed by an MIT-style license that can be
|
|
||||||
* found in the LICENSE file at https://angular.io/license
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test MessagePort monkey patch.
|
|
||||||
*/
|
|
||||||
describe('MessagePort', () => {
|
|
||||||
let iframe: any;
|
|
||||||
beforeEach(() => {
|
|
||||||
iframe = document.createElement('iframe');
|
|
||||||
const html = `<body>
|
|
||||||
<script>
|
|
||||||
window.addEventListener('message', onMessage);
|
|
||||||
function onMessage(e) {
|
|
||||||
// Use the transfered port to post a message back to the main frame
|
|
||||||
e.ports[0].postMessage('Message back from the IFrame');
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</body>`;
|
|
||||||
iframe.src = 'data:text/html;charset=utf-8,' + encodeURI(html);
|
|
||||||
});
|
|
||||||
afterEach(() => {
|
|
||||||
if (iframe) {
|
|
||||||
document.body.removeChild(iframe);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
it('onmessge should in the zone', (done) => {
|
|
||||||
const channel = new MessageChannel();
|
|
||||||
const zone = Zone.current.fork({name: 'zone'});
|
|
||||||
iframe.onload = function() {
|
|
||||||
zone.run(() => {
|
|
||||||
channel.port1.onmessage = function() {
|
|
||||||
expect(Zone.current.name).toBe(zone.name);
|
|
||||||
done();
|
|
||||||
};
|
|
||||||
Zone.current.fork({name: 'zone1'}).run(() => {
|
|
||||||
iframe.contentWindow.postMessage('Hello from the main page!', '*', [channel.port2]);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
document.body.appendChild(iframe);
|
|
||||||
});
|
|
||||||
});
|
|
@ -28,4 +28,3 @@ import './browser/Worker.spec';
|
|||||||
import './mocha-patch.spec';
|
import './mocha-patch.spec';
|
||||||
import './jasmine-patch.spec';
|
import './jasmine-patch.spec';
|
||||||
import './extra/cordova.spec';
|
import './extra/cordova.spec';
|
||||||
import './browser/messageport.spec';
|
|
||||||
|
@ -57,7 +57,6 @@ def karma_test(name, env_srcs, env_deps, env_entry_point, test_srcs, test_deps,
|
|||||||
"//packages/zone.js/dist:zone-patch-fetch.js",
|
"//packages/zone.js/dist:zone-patch-fetch.js",
|
||||||
"//packages/zone.js/dist:zone-patch-resize-observer.js",
|
"//packages/zone.js/dist:zone-patch-resize-observer.js",
|
||||||
"//packages/zone.js/dist:zone-patch-user-media.js",
|
"//packages/zone.js/dist:zone-patch-user-media.js",
|
||||||
"//packages/zone.js/dist:zone-patch-message-port.js",
|
|
||||||
":" + name + "_rollup.umd",
|
":" + name + "_rollup.umd",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -123,8 +123,6 @@ describe('Zone.js npm_package', () => {
|
|||||||
'zone-patch-fetch.min.js',
|
'zone-patch-fetch.min.js',
|
||||||
'zone-patch-jsonp.js',
|
'zone-patch-jsonp.js',
|
||||||
'zone-patch-jsonp.min.js',
|
'zone-patch-jsonp.min.js',
|
||||||
'zone-patch-message-port.js',
|
|
||||||
'zone-patch-message-port.min.js',
|
|
||||||
'zone-patch-promise-test.js',
|
'zone-patch-promise-test.js',
|
||||||
'zone-patch-promise-test.min.js',
|
'zone-patch-promise-test.min.js',
|
||||||
'zone-patch-resize-observer.js',
|
'zone-patch-resize-observer.js',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user