debug icon indicating copy to clipboard operation
debug copied to clipboard

Avoid throwing errors

Open j4k0xb opened this issue 2 years ago • 0 comments

When debugging a web worker script with Pause on caught exceptions enabled it's quite distracting that the debug package throws every time and I have to press continue image

I'd appreciate if it instead uses a more defensive approach:

  • if (exports.storage): https://github.com/debug-js/debug/blob/f66cb2d9f729e1a592e72d3698e3b75329d75a25/src/browser.js#L198-L200 https://github.com/debug-js/debug/blob/f66cb2d9f729e1a592e72d3698e3b75329d75a25/src/browser.js#L218-L219
  • if (typeof localStorage !== 'undefined') https://github.com/debug-js/debug/blob/f66cb2d9f729e1a592e72d3698e3b75329d75a25/src/browser.js#L245-L248

j4k0xb avatar Jan 03 '24 19:01 j4k0xb