zone-patch-message-port.js 559 B

12345678910111213141516
  1. 'use strict';
  2. /**
  3. * @license Angular v<unknown>
  4. * (c) 2010-2022 Google LLC. https://angular.io/
  5. * License: MIT
  6. */
  7. /**
  8. * Monkey patch `MessagePort.prototype.onmessage` and `MessagePort.prototype.onmessageerror`
  9. * properties to make the callback in the zone when the value are set.
  10. */
  11. Zone.__load_patch('MessagePort', (global, Zone, api) => {
  12. const MessagePort = global['MessagePort'];
  13. if (typeof MessagePort !== 'undefined' && MessagePort.prototype) {
  14. api.patchOnProperties(MessagePort.prototype, ['message', 'messageerror']);
  15. }
  16. });