Skip to content

Commit 7567348

Browse files
thePunderWomandylhunn
authored andcommitted
Revert "fix(zone.js): enable monkey patching of the queueMicrotask() API in node.js (#50467)" (#50529)
This reverts commit 381cb98. PR Close #50529
1 parent 069498c commit 7567348

11 files changed

Lines changed: 12 additions & 27 deletions

β€Žpackages/zone.js/karma-build.conf.jsβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ module.exports = function(config) {
1313
config.files.push('build/test/test_fake_polyfill.js');
1414
config.files.push('build/lib/zone.js');
1515
config.files.push('build/lib/common/promise.js');
16-
config.files.push('build/lib/common/queue-microtask.js');
1716
config.files.push('build/test/main.js');
1817
};

β€Žpackages/zone.js/lib/browser/browser.tsβ€Ž

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ Zone.__load_patch('legacy', (global: any) => {
2525
}
2626
});
2727

28+
Zone.__load_patch('queueMicrotask', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
29+
api.patchMethod(global, 'queueMicrotask', delegate => {
30+
return function(self: any, args: any[]) {
31+
Zone.current.scheduleMicroTask('queueMicrotask', args[0]);
32+
}
33+
});
34+
});
35+
36+
2837
Zone.__load_patch('timers', (global: any) => {
2938
const set = 'set';
3039
const clear = 'clear';

β€Žpackages/zone.js/lib/browser/rollup-common.tsβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ import '../zone';
1010
import '../common/promise';
1111
import '../common/to-string';
1212
import './api-util';
13-
import '../common/queue-microtask';

β€Žpackages/zone.js/lib/common/queue-microtask.tsβ€Ž

Lines changed: 0 additions & 19 deletions
This file was deleted.

β€Žpackages/zone.js/lib/node/node.tsβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import './node_util';
1010
import './events';
1111
import './fs';
12-
import '../common/queue-microtask';
1312

1413
import {findEventTasks} from '../common/events';
1514
import {patchTimer} from '../common/timers';

β€Žpackages/zone.js/lib/zone.configurations.api.tsβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,9 @@ interface ZoneGlobalConfigurations {
296296

297297
/**
298298
*
299-
* Disable the monkey patching of the `queueMicrotask()` API.
299+
* Disable the monkey patching of the browser's `queueMicrotask()` API.
300300
*
301-
* By default, `zone.js` monkey patches the `queueMicrotask()` API
301+
* By default, `zone.js` monkey patches the browser's `queueMicrotask()` API
302302
* to ensure that `queueMicrotask()` callback is invoked in the same zone as zone used to invoke
303303
* `queueMicrotask()`. And also the callback is running as `microTask` like
304304
* `Promise.prototype.then()`.

β€Žpackages/zone.js/test/browser-zone-setup.tsβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ if (typeof window !== 'undefined') {
1111
(window as any)[zoneSymbol('fakeAsyncAutoFakeAsyncWhenClockPatched')] = true;
1212
}
1313
import '../lib/common/to-string';
14-
import '../lib/common/queue-microtask';
1514
import '../lib/browser/api-util';
1615
import '../lib/browser/browser-legacy';
1716
import '../lib/browser/browser';
File renamed without changes.

β€Žpackages/zone.js/test/browser_entry_point.tsβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ import './mocha-patch.spec';
2828
import './jasmine-patch.spec';
2929
import './browser/messageport.spec';
3030
import './extra/cordova.spec';
31+
import './browser/queue-microtask.spec';

β€Žpackages/zone.js/test/common_tests.tsβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import './common/zone.spec';
1111
import './common/task.spec';
1212
import './common/util.spec';
1313
import './common/Promise.spec';
14-
import './common/queue-microtask.spec';
1514
import './common/fetch.spec';
1615
import './common/Error.spec';
1716
import './common/setInterval.spec';

0 commit comments

Comments
Β (0)