X Tutup
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/zone.js/karma-build.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ module.exports = function(config) {
config.files.push('build/test/test_fake_polyfill.js');
config.files.push('build/lib/zone.js');
config.files.push('build/lib/common/promise.js');
config.files.push('build/lib/common/queue-microtask.js');
config.files.push('build/test/main.js');
};
9 changes: 0 additions & 9 deletions packages/zone.js/lib/browser/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ Zone.__load_patch('legacy', (global: any) => {
}
});

Zone.__load_patch('queueMicrotask', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
api.patchMethod(global, 'queueMicrotask', delegate => {
return function(self: any, args: any[]) {
Zone.current.scheduleMicroTask('queueMicrotask', args[0]);
}
});
});


Zone.__load_patch('timers', (global: any) => {
const set = 'set';
const clear = 'clear';
Expand Down
1 change: 1 addition & 0 deletions packages/zone.js/lib/browser/rollup-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ import '../zone';
import '../common/promise';
import '../common/to-string';
import './api-util';
import '../common/queue-microtask';
19 changes: 19 additions & 0 deletions packages/zone.js/lib/common/queue-microtask.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* @license
* Copyright Google LLC 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
*/
/**
* @fileoverview
* @suppress {missingRequire}
*/

Zone.__load_patch('queueMicrotask', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
api.patchMethod(global, 'queueMicrotask', delegate => {
return function(self: any, args: any[]) {
Zone.current.scheduleMicroTask('queueMicrotask', args[0]);
}
});
});
1 change: 1 addition & 0 deletions packages/zone.js/lib/node/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import './node_util';
import './events';
import './fs';
import '../common/queue-microtask';

import {findEventTasks} from '../common/events';
import {patchTimer} from '../common/timers';
Expand Down
4 changes: 2 additions & 2 deletions packages/zone.js/lib/zone.configurations.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,9 @@ interface ZoneGlobalConfigurations {

/**
*
* Disable the monkey patching of the browser's `queueMicrotask()` API.
* Disable the monkey patching of the `queueMicrotask()` API.
*
* By default, `zone.js` monkey patches the browser's `queueMicrotask()` API
* By default, `zone.js` monkey patches the `queueMicrotask()` API
* to ensure that `queueMicrotask()` callback is invoked in the same zone as zone used to invoke
* `queueMicrotask()`. And also the callback is running as `microTask` like
* `Promise.prototype.then()`.
Expand Down
1 change: 1 addition & 0 deletions packages/zone.js/test/browser-zone-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ if (typeof window !== 'undefined') {
(window as any)[zoneSymbol('fakeAsyncAutoFakeAsyncWhenClockPatched')] = true;
}
import '../lib/common/to-string';
import '../lib/common/queue-microtask';
import '../lib/browser/api-util';
import '../lib/browser/browser-legacy';
import '../lib/browser/browser';
Expand Down
1 change: 0 additions & 1 deletion packages/zone.js/test/browser_entry_point.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ import './mocha-patch.spec';
import './jasmine-patch.spec';
import './browser/messageport.spec';
import './extra/cordova.spec';
import './browser/queue-microtask.spec';
1 change: 1 addition & 0 deletions packages/zone.js/test/common_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import './common/zone.spec';
import './common/task.spec';
import './common/util.spec';
import './common/Promise.spec';
import './common/queue-microtask.spec';
import './common/fetch.spec';
import './common/Error.spec';
import './common/setInterval.spec';
Expand Down
1 change: 1 addition & 0 deletions packages/zone.js/test/node_error_entry_point.init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import './test_fake_polyfill';
// Setup tests for Zone without microtask support
import '../lib/zone';
import '../lib/common/promise';
import '../lib/common/queue-microtask';
import '../lib/common/to-string';
import './test-env-setup-jasmine';
import './wtf_mock';
Expand Down
X Tutup