Changeset 117961 in webkit


Ignore:
Timestamp:
May 22, 2012 6:07:14 AM (12 years ago)
Author:
yurys@chromium.org
Message:

Web Inspector: annotate InjectedScriptSource.js for closure compiler
https://bugs.webkit.org/show_bug.cgi?id=87120

Reviewed by Pavel Feldman.

Annotated InjectedScriptSource.js for closure compiler. Replaced call of undefined
_isPrimitiveValue function with isPrimitiveValue.

  • inspector/InjectedScriptExterns.js: Added. External APIs used in InjectedScriptSource.js

(console.log):
(InjectedScriptHost.prototype.storageId):
(InjectedScriptHost.prototype.functionDetails):
(InjectedScriptHost.prototype.isHTMLAllCollection):
(InjectedScriptHost.prototype.internalConstructorName):
(InjectedScriptHost.prototype.copyText):
(InjectedScriptHost.prototype.clearConsoleMessages):
(InjectedScriptHost.prototype.inspectedObject):
(InjectedScriptHost.prototype.databaseId):
(InjectedScriptHost.prototype.inspect):
(InjectedScriptHost.prototype.type):
(InjectedScriptHost.prototype.getEventListeners):
(JavaScriptCallFrame.prototype.scopeType):

  • inspector/InjectedScriptSource.js:
Location:
trunk/Source/WebCore
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r117960 r117961  
     12012-05-22  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Web Inspector: annotate InjectedScriptSource.js for closure compiler
     4        https://bugs.webkit.org/show_bug.cgi?id=87120
     5
     6        Reviewed by Pavel Feldman.
     7
     8        Annotated InjectedScriptSource.js for closure compiler. Replaced call of undefined
     9        _isPrimitiveValue function with isPrimitiveValue.
     10
     11        * inspector/InjectedScriptExterns.js: Added. External APIs used in InjectedScriptSource.js
     12        (console.log):
     13        (InjectedScriptHost.prototype.storageId):
     14        (InjectedScriptHost.prototype.functionDetails):
     15        (InjectedScriptHost.prototype.isHTMLAllCollection):
     16        (InjectedScriptHost.prototype.internalConstructorName):
     17        (InjectedScriptHost.prototype.copyText):
     18        (InjectedScriptHost.prototype.clearConsoleMessages):
     19        (InjectedScriptHost.prototype.inspectedObject):
     20        (InjectedScriptHost.prototype.databaseId):
     21        (InjectedScriptHost.prototype.inspect):
     22        (InjectedScriptHost.prototype.type):
     23        (InjectedScriptHost.prototype.getEventListeners):
     24        (JavaScriptCallFrame.prototype.scopeType):
     25        * inspector/InjectedScriptSource.js:
     26
    1272012-05-22  Ian Vollick  <vollick@chromium.org>
    228
  • trunk/Source/WebCore/inspector/InjectedScriptSource.js

    r117599 r117961  
    2727 */
    2828
     29/**
     30 * @param {InjectedScriptHost} InjectedScriptHost
     31 */
    2932(function (InjectedScriptHost, inspectedWindow, injectedScriptId) {
    3033
    31 function bind(thisObject, memberFunction)
    32 {
    33     var func = memberFunction;
    34     var args = Array.prototype.slice.call(arguments, 2);
    35     function bound()
    36     {
    37         return func.apply(thisObject, args.concat(Array.prototype.slice.call(arguments, 0)));
    38     }
    39     bound.toString = function() {
    40         return "bound: " + func;
    41     };
    42     return bound;
    43 }
    44 
     34/**
     35 * @constructor
     36 */
    4537var InjectedScript = function()
    4638{
     
    7264        var result = {};
    7365        result.type = typeof object;
    74         if (this._isPrimitiveValue(object))
     66        if (this.isPrimitiveValue(object))
    7567            result.value = object;
    7668        else
     
    225217        var descriptors = [];
    226218        var nameProcessed = {};
    227         nameProcessed.__proto__ = null;
     219        nameProcessed["__proto__"] = null;
    228220        for (var o = object; this._isDefined(o); o = o.__proto__) {
    229221            var names = Object.getOwnPropertyNames(o);
     
    279271            args = eval(args);
    280272            for (var i = 0; i < args.length; ++i) {
    281                 var objectId = args[i].objectId;
     273                objectId = args[i].objectId;
    282274                if (objectId) {
    283275                    var parsedArgId = this._parseObjectId(objectId);
     
    373365    {
    374366        var parsedCallFrameId = eval("(" + callFrameId + ")");
    375         var ordinal = parsedCallFrameId.ordinal;
     367        var ordinal = parsedCallFrameId["ordinal"];
    376368        var callFrame = topCallFrame;
    377369        while (--ordinal >= 0 && callFrame)
     
    483475var injectedScript = new InjectedScript();
    484476
     477/**
     478 * @constructor
     479 * @param {*} object
     480 * @param {string=} objectGroupName
     481 * @param {boolean=} forceValueType
     482 */
    485483InjectedScript.RemoteObject = function(object, objectGroupName, forceValueType)
    486484{
     
    509507}
    510508
     509/**
     510 * @constructor
     511 * @param {number} ordinal
     512 */
    511513InjectedScript.CallFrameProxy = function(ordinal, callFrame)
    512514{
     
    549551}
    550552
     553/**
     554 * @constructor
     555 */
    551556function CommandLineAPI(commandLineAPIImpl, callFrame)
    552557{
     
    569574            continue;
    570575
    571         this[member] = bind(commandLineAPIImpl, commandLineAPIImpl[member]);
     576        this[member] = commandLineAPIImpl[member].bind(commandLineAPIImpl);
    572577    }
    573578
     
    577582            continue;
    578583
    579         this.__defineGetter__("$" + i, bind(commandLineAPIImpl, commandLineAPIImpl._inspectedObject, i));
     584        this.__defineGetter__("$" + i, commandLineAPIImpl._inspectedObject.bind(commandLineAPIImpl, i));
    580585    }
    581586}
     
    586591];
    587592
     593/**
     594 * @constructor
     595 */
    588596function CommandLineAPIImpl()
    589597{
  • trunk/Source/WebCore/inspector/compile-front-end.sh

    r110550 r117961  
    3333python Source/WebCore/inspector/compile-front-end.py
    3434
     35echo "Compiling InjectedScriptSource.js..."
     36java -jar ~/closure/compiler.jar\
     37    --summary_detail_level 3\
     38    --compilation_level SIMPLE_OPTIMIZATIONS\
     39    --warning_level VERBOSE\
     40    --language_in ECMASCRIPT5\
     41    --accept_const_keyword\
     42    --js Source/WebCore/inspector/InjectedScriptSource.js\
     43    --externs Source/WebCore/inspector/InjectedScriptExterns.js
Note: See TracChangeset for help on using the changeset viewer.