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

12345678910111213141516171819202122
  1. 'use strict';
  2. /**
  3. * @license Angular v<unknown>
  4. * (c) 2010-2022 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. /**
  13. * Monkey patch `MessagePort.prototype.onmessage` and `MessagePort.prototype.onmessageerror`
  14. * properties to make the callback in the zone when the value are set.
  15. */
  16. Zone.__load_patch('MessagePort', function (global, Zone, api) {
  17. var MessagePort = global['MessagePort'];
  18. if (typeof MessagePort !== 'undefined' && MessagePort.prototype) {
  19. api.patchOnProperties(MessagePort.prototype, ['message', 'messageerror']);
  20. }
  21. });
  22. }));