zone-patch-message-port.umd.js 864 B

12345678910111213141516171819202122232425
  1. 'use strict';
  2. /**
  3. * @license Angular v<unknown>
  4. * (c) 2010-2025 Google LLC. https://angular.io/
  5. * License: MIT
  6. */
  7. (function (factory) {
  8. typeof define === 'function' && define.amd ? define(factory) :
  9. factory();
  10. })((function () {
  11. 'use strict';
  12. function patchMessagePort(Zone) {
  13. /**
  14. * Monkey patch `MessagePort.prototype.onmessage` and `MessagePort.prototype.onmessageerror`
  15. * properties to make the callback in the zone when the value are set.
  16. */
  17. Zone.__load_patch('MessagePort', function (global, Zone, api) {
  18. var MessagePort = global['MessagePort'];
  19. if (typeof MessagePort !== 'undefined' && MessagePort.prototype) {
  20. api.patchOnProperties(MessagePort.prototype, ['message', 'messageerror']);
  21. }
  22. });
  23. }
  24. patchMessagePort(Zone);
  25. }));