browser-index.js 1.2 KB

123456789101112131415161718192021222324252627
  1. // Copyright (c) .NET Foundation. All rights reserved.
  2. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
  3. // This is where we add any polyfills we'll need for the browser. It is the entry module for browser-specific builds.
  4. import "es6-promise/dist/es6-promise.auto.js";
  5. // Copy from Array.prototype into Uint8Array to polyfill on IE. It's OK because the implementations of indexOf and slice use properties
  6. // that exist on Uint8Array with the same name, and JavaScript is magic.
  7. // We make them 'writable' because the Buffer polyfill messes with it as well.
  8. if (!Uint8Array.prototype.indexOf) {
  9. Object.defineProperty(Uint8Array.prototype, "indexOf", {
  10. value: Array.prototype.indexOf,
  11. writable: true,
  12. });
  13. }
  14. if (!Uint8Array.prototype.slice) {
  15. Object.defineProperty(Uint8Array.prototype, "slice", {
  16. value: Array.prototype.slice,
  17. writable: true,
  18. });
  19. }
  20. if (!Uint8Array.prototype.forEach) {
  21. Object.defineProperty(Uint8Array.prototype, "forEach", {
  22. value: Array.prototype.forEach,
  23. writable: true,
  24. });
  25. }
  26. export * from "./index";
  27. //# sourceMappingURL=browser-index.js.map