Changeset 248595 in webkit


Ignore:
Timestamp:
Aug 13, 2019 8:34:29 AM (5 years ago)
Author:
Joseph Pecoraro
Message:

JSContext Inspector: Basic CommandLineAPI doesn't work
https://bugs.webkit.org/show_bug.cgi?id=200659
<rdar://problem/54245476>

Reviewed by Brian Burg.

  • inspector/InjectedScriptSource.js:

(BasicCommandLineAPI):
Use method directly since it already has been setup nicely and doesn't
need to be bound. Technically this allows someone to add properties to
the CommandLineAPI methods in basic mode (dir.property = 1) but that
seems harmless.

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r248552 r248595  
     12019-08-13  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        JSContext Inspector: Basic CommandLineAPI doesn't work
     4        https://bugs.webkit.org/show_bug.cgi?id=200659
     5        <rdar://problem/54245476>
     6
     7        Reviewed by Brian Burg.
     8
     9        * inspector/InjectedScriptSource.js:
     10        (BasicCommandLineAPI):
     11        Use `method` directly since it already has been setup nicely and doesn't
     12        need to be bound. Technically this allows someone to add properties to
     13        the CommandLineAPI methods in basic mode (`dir.property = 1`) but that
     14        seems harmless.
     15
    1162019-08-12  Sam Weinig  <weinig@apple.com>
    217
  • trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js

    r248434 r248595  
    291291            let value = this._resolveCallArgument(callArgument);
    292292            this._saveResult(value);
    293         } catch (e) {}
     293        } catch { }
    294294
    295295        return this._savedResultIndex;
     
    515515        try {
    516516            remoteObject.description = toStringDescription(value);
    517         } catch (e) {}
     517        } catch { }
    518518        return {
    519519            wasThrown: true,
     
    745745        try {
    746746            isArrayLike = RemoteObject.subtype(object) === "array" && isFinite(object.length) && object.length > 0;
    747         } catch(e) {}
     747        } catch { }
    748748
    749749        for (let o = object; isDefined(o); o = Object.getPrototypeOf(o)) {
     
    766766            if (object.__proto__)
    767767                descriptors.push({name: "__proto__", value: object.__proto__, writable: true, configurable: true, enumerable: false, isOwn: true});
    768         } catch (e) {}
     768        } catch { }
    769769
    770770        return descriptors;
     
    867867        return this._savedResults[index];
    868868    }
    869 }
     869};
    870870
    871871InjectedScript.CollectionMode = {
     
    981981            if (typeof value.splice === "function" && isFinite(value.length))
    982982                return "array";
    983         } catch (e) {}
     983        } catch { }
    984984
    985985        return null;
     
    11351135            if (propertiesThreshold.indexes < 0 || propertiesThreshold.properties < 0)
    11361136                return preview;
    1137         } catch (e) {
     1137        } catch {
    11381138            preview.lossless = false;
    11391139        }
     
    13871387        return string.substr(0, maxLength) + "\u2026";
    13881388    }
    1389 }
     1389};
    13901390
    13911391// -------
     
    13991399    this.this = RemoteObject.create(callFrame.thisObject, "backtrace");
    14001400    this.isTailDeleted = callFrame.isTailDeleted;
    1401 }
     1401};
    14021402
    14031403InjectedScript.CallFrameProxy.prototype = {
     
    14121412        return scopeChainProxy;
    14131413    }
    1414 }
     1414};
    14151415
    14161416InjectedScript.CallFrameProxy._scopeTypeNames = {
     
    14831483    for (let i = 0; i < BasicCommandLineAPI.methods.length; ++i) {
    14841484        let method = BasicCommandLineAPI.methods[i];
    1485         this[method] = bind(commandLineAPIImpl[method], commandLineAPIImpl);
    1486         this[method].toString = function() { return "function " + method + "() { [Command Line API] }" };
     1485        this[method.name] = method;
    14871486    }
    14881487}
Note: See TracChangeset for help on using the changeset viewer.