3 Replies Latest reply on May 30, 2017 1:23 PM by rashedtalukder

    Tile configuration breaks Array prototype in config

    michael_yegorov

      In our company we use polyfills in tile development - like babel-polyfill or it's base - core-js. If browser doesn't support modern interface of arrays, objects, etc - the polyfill extends their prototypes to use methods like "findIndex", "map" and many others.

       

      Yesterday I found troubling bug: when I load the config in a tile with jive.tile.onOpen(function (config, options) {}) - arrays present in the config object don't pass a test on instanceof Array and the polyfilled methods are not available in IE11 and possibly other browsers which actually require the polyfill to use those methods.

       

      I checked thoroughly - before config is saved by jive.tile.close, all arrays are instances of Array. The error only appears on load of config.

       

      There are ways to fix this, I use the next turnaround: config = JSON.parse(JSON.stringify(config)), but I think this is actually a bug.