oldie-polyfills.src.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. /**
  2. * @license Highcharts JS v7.0.2 (2019-01-17)
  3. * Old IE (v6, v7, v8) array polyfills for Highcharts v7+.
  4. *
  5. * (c) 2010-2019 Highsoft AS
  6. * Author: Torstein Honsi
  7. *
  8. * License: www.highcharts.com/license
  9. */
  10. 'use strict';
  11. (function (factory) {
  12. if (typeof module === 'object' && module.exports) {
  13. factory['default'] = factory;
  14. module.exports = factory;
  15. } else if (typeof define === 'function' && define.amd) {
  16. define(function () {
  17. return factory;
  18. });
  19. } else {
  20. factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined);
  21. }
  22. }(function (Highcharts) {
  23. (function () {
  24. /**
  25. * (c) 2010-2019 Torstein Honsi
  26. *
  27. * Simple polyfills for array functions in old IE browsers (6, 7 and 8) in
  28. * Highcharts v7+. These polyfills are sufficient for Highcharts to work, but
  29. * for fully compatible polyfills, see MDN.
  30. *
  31. * License: www.highcharts.com/license
  32. */
  33. /* eslint no-extend-native: 0 */
  34. if (!Array.prototype.forEach) {
  35. Array.prototype.forEach = function (fn, ctx) {
  36. var i = 0,
  37. len = this.length;
  38. for (; i < len; i++) {
  39. if (
  40. this[i] !== undefined && // added check
  41. fn.call(ctx, this[i], i, this) === false
  42. ) {
  43. return i;
  44. }
  45. }
  46. };
  47. }
  48. if (!Array.prototype.map) {
  49. Array.prototype.map = function (fn) {
  50. var results = [],
  51. i = 0,
  52. len = this.length;
  53. for (; i < len; i++) {
  54. results[i] = fn.call(this[i], this[i], i, this);
  55. }
  56. return results;
  57. };
  58. }
  59. if (!Array.prototype.indexOf) {
  60. Array.prototype.indexOf = function (member, fromIndex) {
  61. var arr = this, // #8874
  62. len,
  63. i = fromIndex || 0; // #8346
  64. if (arr) {
  65. len = arr.length;
  66. for (; i < len; i++) {
  67. if (arr[i] === member) {
  68. return i;
  69. }
  70. }
  71. }
  72. return -1;
  73. };
  74. }
  75. if (!Array.prototype.filter) {
  76. Array.prototype.filter = function (fn) {
  77. var ret = [],
  78. i = 0,
  79. length = this.length;
  80. for (; i < length; i++) {
  81. if (fn(this[i], i)) {
  82. ret.push(this[i]);
  83. }
  84. }
  85. return ret;
  86. };
  87. }
  88. if (!Array.prototype.some) {
  89. Array.prototype.some = function (fn, ctx) { // legacy
  90. var i = 0,
  91. len = this.length;
  92. for (; i < len; i++) {
  93. if (fn.call(ctx, this[i], i, this) === true) {
  94. return true;
  95. }
  96. }
  97. return false;
  98. };
  99. }
  100. if (!Array.prototype.reduce) {
  101. Array.prototype.reduce = function (func, initialValue) {
  102. var context = this,
  103. i = arguments.length > 1 ? 0 : 1,
  104. accumulator = arguments.length > 1 ? initialValue : this[0],
  105. len = this.length;
  106. for (; i < len; ++i) {
  107. accumulator = func.call(context, accumulator, this[i], i, this);
  108. }
  109. return accumulator;
  110. };
  111. }
  112. if (!Object.keys) {
  113. Object.keys = function (obj) {
  114. var result = [],
  115. hasOwnProperty = Object.prototype.hasOwnProperty,
  116. prop;
  117. for (prop in obj) {
  118. if (hasOwnProperty.call(obj, prop)) {
  119. result.push(prop);
  120. }
  121. }
  122. return result;
  123. };
  124. }
  125. }());
  126. return (function () {
  127. }());
  128. }));