Changeset 94958 in webkit


Ignore:
Timestamp:
Sep 12, 2011 8:24:53 AM (13 years ago)
Author:
pfeldman@chromium.org
Message:

Web Inspector: Runtime.callFunctionOn does not accept arguments that evaluate to false.
https://bugs.webkit.org/show_bug.cgi?id=67934

Reviewed by Tony Gentilcore.

Source/WebCore:

  • inspector/InjectedScriptSource.js:

LayoutTests:

  • inspector/runtime/runtime-setPropertyValue.html:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r94953 r94958  
     12011-09-12  Pavel Feldman  <pfeldman@google.com>
     2
     3        Web Inspector: Runtime.callFunctionOn does not accept arguments that evaluate to false.
     4        https://bugs.webkit.org/show_bug.cgi?id=67934
     5
     6        Reviewed by Tony Gentilcore.
     7
     8        * inspector/runtime/runtime-setPropertyValue.html:
     9
    1102011-09-12  Kentaro Hara  <haraken@google.com>
    211
  • trunk/LayoutTests/inspector/runtime/runtime-setPropertyValue-expected.txt

    r92961 r94958  
    11CONSOLE MESSAGE: line 11: ===== Initial =====
    22CONSOLE MESSAGE: line 12: {"foo":1}
    3 CONSOLE MESSAGE: line 13: {"bar":2}
    4 CONSOLE MESSAGE: line 14:
     3CONSOLE MESSAGE: line 13:
    54CONSOLE MESSAGE: line 11: ===== Set primitive =====
    65CONSOLE MESSAGE: line 12: {"foo":2}
    7 CONSOLE MESSAGE: line 13: {"bar":2}
    8 CONSOLE MESSAGE: line 14:
     6CONSOLE MESSAGE: line 13:
    97CONSOLE MESSAGE: line 11: ===== Set handle =====
    108CONSOLE MESSAGE: line 12: {"foo":{"bar":2}}
    11 CONSOLE MESSAGE: line 13: {"bar":2}
    12 CONSOLE MESSAGE: line 14:
     9CONSOLE MESSAGE: line 13:
    1310CONSOLE MESSAGE: line 11: ===== Set undefined =====
    1411CONSOLE MESSAGE: line 12: {}
    15 CONSOLE MESSAGE: line 13: {"bar":2}
    16 CONSOLE MESSAGE: line 14:
     12CONSOLE MESSAGE: line 13:
     13CONSOLE MESSAGE: line 11: ===== Set zero =====
     14CONSOLE MESSAGE: line 12: {"foo":0}
     15CONSOLE MESSAGE: line 13:
     16CONSOLE MESSAGE: line 11: ===== Set null =====
     17CONSOLE MESSAGE: line 12: {"foo":null}
     18CONSOLE MESSAGE: line 13:
     19CONSOLE MESSAGE: line 11: ===== Set empty string =====
     20CONSOLE MESSAGE: line 12: {"foo":""}
     21CONSOLE MESSAGE: line 13:
    1722CONSOLE MESSAGE: line 11: ===== Set exception =====
    18 CONSOLE MESSAGE: line 12: {}
    19 CONSOLE MESSAGE: line 13: {"bar":2}
    20 CONSOLE MESSAGE: line 14:
     23CONSOLE MESSAGE: line 12: {"foo":""}
     24CONSOLE MESSAGE: line 13:
    2125Tests WebInspector.RemoveObject.setPropertyValue implementation.
    2226
     
    3034Running: testSetUndefined
    3135
     36Running: testSetZero
     37
     38Running: testSetNull
     39
     40Running: testSetEmptyString
     41
    3242Running: testSetException
    3343{
  • trunk/LayoutTests/inspector/runtime/runtime-setPropertyValue.html

    r91754 r94958  
    77var object2 = { bar: 2 };
    88
    9 function dumpObjects(label)
     9function dumpObject(label)
    1010{
    1111    console.log("===== " + label + " =====");
    1212    console.log(JSON.stringify(object1));
    13     console.log(JSON.stringify(object2));
    1413    console.log("");
    1514}
     
    2221        function testSetUp(next)
    2322        {
    24             InspectorTest.evaluateInPage("dumpObjects('Initial')", step0);
     23            InspectorTest.evaluateInPage("dumpObject('Initial')", step0);
    2524
    2625            function step0()
     
    4847            function step1()
    4948            {
    50                 InspectorTest.evaluateInPage("dumpObjects('Set primitive')", next);
     49                InspectorTest.evaluateInPage("dumpObject('Set primitive')", next);
    5150            }
    5251        },
     
    5857            function step1()
    5958            {
    60                 InspectorTest.evaluateInPage("dumpObjects('Set handle')", next);
     59                InspectorTest.evaluateInPage("dumpObject('Set handle')", next);
    6160            }
    6261        },
     
    6867            function step1()
    6968            {
    70                 InspectorTest.evaluateInPage("dumpObjects('Set undefined')", next);
     69                InspectorTest.evaluateInPage("dumpObject('Set undefined')", next);
     70            }
     71        },
     72
     73        function testSetZero(next)
     74        {
     75            obj1.setPropertyValue("foo", "0", step1);
     76
     77            function step1()
     78            {
     79                InspectorTest.evaluateInPage("dumpObject('Set zero')", next);
     80            }
     81        },
     82
     83        function testSetNull(next)
     84        {
     85            obj1.setPropertyValue("foo", "null", step1);
     86
     87            function step1()
     88            {
     89                InspectorTest.evaluateInPage("dumpObject('Set null')", next);
     90            }
     91        },
     92
     93        function testSetEmptyString(next)
     94        {
     95            obj1.setPropertyValue("foo", "\"\"", step1);
     96
     97            function step1()
     98            {
     99                InspectorTest.evaluateInPage("dumpObject('Set empty string')", next);
    71100            }
    72101        },
     
    79108            {
    80109                InspectorTest.dump(error);
    81                 InspectorTest.evaluateInPage("dumpObjects('Set exception')", next);
     110                InspectorTest.evaluateInPage("dumpObject('Set exception')", next);
    82111            }
    83112        }
  • trunk/Source/WebCore/ChangeLog

    r94957 r94958  
     12011-09-12  Pavel Feldman  <pfeldman@google.com>
     2
     3        Web Inspector: Runtime.callFunctionOn does not accept arguments that evaluate to false.
     4        https://bugs.webkit.org/show_bug.cgi?id=67934
     5
     6        Reviewed by Tony Gentilcore.
     7
     8        * inspector/InjectedScriptSource.js:
     9
    1102011-09-12  Pavel Feldman  <pfeldman@google.com>
    211
  • trunk/Source/WebCore/inspector/InjectedScriptSource.js

    r93037 r94958  
    276276
    277277                    resolvedArgs.push(resolvedArg);
    278                 } else if (args[i].value)
     278                } else if ("value" in args[i])
    279279                    resolvedArgs.push(args[i].value);
    280280                else
Note: See TracChangeset for help on using the changeset viewer.