mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
7837f7119f
Similar to the browser, now we also monkey patch `queueMicrotask` in Node.js. This API was added in Node.js 11. PR Close #50530
20 lines
514 B
TypeScript
20 lines
514 B
TypeScript
/**
|
|
* @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}
|
|
*/
|
|
|
|
export function patchQueueMicrotask(global: any, api: _ZonePrivate) {
|
|
api.patchMethod(global, 'queueMicrotask', (delegate) => {
|
|
return function(self: any, args: any[]) {
|
|
Zone.current.scheduleMicroTask('queueMicrotask', args[0]);
|
|
};
|
|
});
|
|
}
|