gilbarbara / tree-changes

Compare changes between two datasets
22 stars 6 forks source link

Breaking in case of IE #4

Closed vikalpgupta-birdeye closed 5 years ago

vikalpgupta-birdeye commented 5 years ago

I am having issue using react-joyride because of this, Its breaking on IE, getting this error "Object.getPrototypeOf: 'this' is not an Object", because of the code in src/index.js

`function isPlainObj(...args: any): boolean { return args.every(d => { if (!d) return false; const prototype = Object.getPrototypeOf(d);

return Object.prototype.toString.call(d)
  .slice(8, -1) === 'Object' && (prototype === null || prototype === Object.getPrototypeOf({}));

}); }`

gilbarbara commented 5 years ago

You'll need a polyfill if you need to support IE

vikalpgupta-birdeye commented 5 years ago

Hi @gilbarbara I tried using a polyfill here but it was still not able to handle the error in above code, can you please see if you can include catch this particular error somehow so that it does not break javscript execution.

gilbarbara commented 5 years ago

Not really, I'm dropping support for IE in all my packages.

vikalpgupta-birdeye commented 5 years ago

@gilbarbara Is there any other way that I can still use joyride on IE having a dependency on this without using a polyfill, as I tried with a polyfill but it was of no use to me. I feel one of the arguments passed is wrong. If it feels right I can also create a PR for the same