Changeset 48536 in webkit


Ignore:
Timestamp:
Sep 18, 2009 2:58:39 PM (15 years ago)
Author:
eric@webkit.org
Message:

2009-09-18 Yury Semikhatsky <yurys@chromium.org>

Reviewed by Timothy Hatcher.

Fix parameter substitutions in console.log().

https://bugs.webkit.org/show_bug.cgi?id=29366

  • inspector/front-end/ConsoleView.js: (WebInspector.ConsoleMessage.prototype._format):
  • inspector/front-end/InjectedScript.js: (InjectedScript.getPrototypes): (InjectedScript.CallFrameProxy.prototype._wrapScopeChain):
  • inspector/front-end/utilities.js: ():
Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r48533 r48536  
     12009-09-18  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        Fix parameter substitutions in console.log().
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=29366
     8
     9        * inspector/front-end/ConsoleView.js:
     10        (WebInspector.ConsoleMessage.prototype._format):
     11        * inspector/front-end/InjectedScript.js:
     12        (InjectedScript.getPrototypes):
     13        (InjectedScript.CallFrameProxy.prototype._wrapScopeChain):
     14        * inspector/front-end/utilities.js:
     15        ():
     16
    1172009-09-18  Sam Weinig  <sam@webkit.org>
    218
  • trunk/WebCore/inspector/front-end/ConsoleView.js

    r48497 r48536  
    640640        }
    641641
    642         if (typeof parameters[0] === "string") {
     642        if (Object.proxyType(parameters[0]) === "string") {
    643643            var formatters = {}
    644644            for (var i in String.standardFormatters)
     
    661661            }
    662662
    663             var result = String.format(parameters[0], parameters.slice(1), formatters, formattedResult, append);
     663            var result = String.format(parameters[0].description, parameters.slice(1), formatters, formattedResult, append);
    664664            formattedResult = result.formattedResult;
    665665            parameters = result.unusedSubstitutions;
  • trunk/WebCore/inspector/front-end/InjectedScript.js

    r48491 r48536  
    422422    var result = [];
    423423    for (var prototype = node; prototype; prototype = prototype.__proto__) {
    424         var title = Object.describe(prototype);
     424        var title = Object.describe(prototype, true);
    425425        if (title.match(/Prototype$/)) {
    426426            title = title.replace(/Prototype$/, "");
     
    10001000        for (var i = 0; i < scopeChain.length; ++i) {
    10011001            var scopeObject = scopeChain[i];
    1002             var scopeObjectProxy = InjectedScript.createProxyObject(scopeObject, { callFrame: this.id, chainIndex: i });
     1002            var scopeObjectProxy = InjectedScript.createProxyObject(scopeObject, { callFrame: this.id, chainIndex: i }, true);
    10031003
    10041004            if (Object.prototype.toString.call(scopeObject) === "[object JSActivation]") {
    10051005                if (!foundLocalScope)
    1006                     scopeObjectProxy.thisObject = InjectedScript.createProxyObject(callFrame.thisObject, { callFrame: this.id, thisObject: true });
     1006                    scopeObjectProxy.thisObject = InjectedScript.createProxyObject(callFrame.thisObject, { callFrame: this.id, thisObject: true }, true);
    10071007                else
    10081008                    scopeObjectProxy.isClosure = true;
     
    10781078        return "[" + obj.toString() + "]";
    10791079    case "string":
     1080        if (!abbreviated)
     1081            return obj;
    10801082        if (obj.length > 100)
    10811083            return "\"" + obj.substring(0, 100) + "\u2026\"";
     
    10901092    case "regexp":
    10911093        return String(obj).replace(/([\\\/])/g, "\\$1").replace(/\\(\/[gim]*)$/, "$1").substring(1);
     1094    case "boolean":
     1095    case "number":
     1096    case "null":
     1097        return obj;
    10921098    default:
    10931099        return String(obj);
  • trunk/WebCore/inspector/front-end/utilities.js

    r48392 r48536  
    815815    d: function(substitution)
    816816    {
     817        if (typeof substitution == "object" && Object.proxyType(substitution) === "number")
     818            substitution = substitution.description;
    817819        substitution = parseInt(substitution);
    818820        return !isNaN(substitution) ? substitution : 0;
     
    821823    f: function(substitution, token)
    822824    {
     825        if (typeof substitution == "object" && Object.proxyType(substitution) === "number")
     826            substitution = substitution.description;
    823827        substitution = parseFloat(substitution);
    824828        if (substitution && token.precision > -1)
     
    829833    s: function(substitution)
    830834    {
     835        if (typeof substitution == "object" && Object.proxyType(substitution) !== "null")
     836            substitution = substitution.description;
    831837        return substitution;
    832838    },
Note: See TracChangeset for help on using the changeset viewer.