debug-js/debug

Avoid throwing errors

j4k0xb opened this issue · 0 comments

j4k0xb commented

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):

    debug/src/browser.js

    Lines 198 to 200 in f66cb2d

    try {
    if (namespaces) {
    exports.storage.setItem('debug', namespaces);

    debug/src/browser.js

    Lines 218 to 219 in f66cb2d

    try {
    r = exports.storage.getItem('debug');
  • if (typeof localStorage !== 'undefined')

    debug/src/browser.js

    Lines 245 to 248 in f66cb2d

    try {
    // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
    // The Browser also has localStorage in the global context.
    return localStorage;