Skip to content

Avoid throwing errors #954

Open
Open
@j4k0xb

Description

@j4k0xb

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions