Changeset 56676 in webkit


Ignore:
Timestamp:
Mar 27, 2010 7:32:49 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-03-27 Dmitry Gorbik <socket.h@gmail.com>

Reviewed by Pavel Feldman.

Fix the regression caused by r28078: a global variable
definition masks a local one in an inspector console
https://bugs.webkit.org/show_bug.cgi?id=32442

  • inspector/front-end/InjectedScript.js: (injectedScriptConstructor):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r56673 r56676  
     12010-03-27  Dmitry Gorbik  <socket.h@gmail.com>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Fix the regression caused by r28078: a global variable
     6        definition masks a local one in an inspector console
     7        https://bugs.webkit.org/show_bug.cgi?id=32442
     8
     9        * inspector/front-end/InjectedScript.js:
     10        (injectedScriptConstructor):
     11
    1122010-03-27  Dan Bernstein  <mitz@apple.com>
    213
  • trunk/WebCore/inspector/front-end/InjectedScript.js

    r56532 r56676  
    235235                return props;
    236236            if (expression)
    237                 expressionResult = InjectedScript._evaluateOn(callFrame.evaluate, callFrame, expression);
     237                expressionResult = InjectedScript._evaluateOn(callFrame.evaluate, callFrame, expression, true);
    238238            else {
    239239                // Evaluate into properties in scope of the selected call frame.
     
    263263}
    264264
    265 InjectedScript._evaluateAndWrap = function(evalFunction, object, expression, objectGroup)
     265InjectedScript._evaluateAndWrap = function(evalFunction, object, expression, objectGroup, dontUseCommandLineAPI)
    266266{
    267267    var result = {};
    268268    try {
    269         result.value = InjectedScript.wrapObject(InjectedScript._evaluateOn(evalFunction, object, expression), objectGroup);
     269        result.value = InjectedScript.wrapObject(InjectedScript._evaluateOn(evalFunction, object, expression, dontUseCommandLineAPI), objectGroup);
    270270
    271271        // Handle error that might have happened while describing result.
     
    281281}
    282282
    283 InjectedScript._evaluateOn = function(evalFunction, object, expression)
     283InjectedScript._evaluateOn = function(evalFunction, object, expression, dontUseCommandLineAPI)
    284284{
    285285    InjectedScript._ensureCommandLineAPIInstalled(evalFunction, object);
    286286    // Surround the expression in with statements to inject our command line API so that
    287287    // the window object properties still take more precedent than our API functions.
    288     expression = "with (window.console._inspectorCommandLineAPI) { with (window) {\n" + expression + "\n} }";
     288    if (!dontUseCommandLineAPI)
     289        expression = "with (window.console._inspectorCommandLineAPI) { with (window) {\n" + expression + "\n} }";
     290
    289291    var value = evalFunction.call(object, expression);
    290292
     
    584586    if (!callFrame)
    585587        return false;
    586     return InjectedScript._evaluateAndWrap(callFrame.evaluate, callFrame, code, objectGroup);
     588    return InjectedScript._evaluateAndWrap(callFrame.evaluate, callFrame, code, objectGroup, true);
    587589}
    588590
Note: See TracChangeset for help on using the changeset viewer.