Changeset 199745 in webkit


Ignore:
Timestamp:
Apr 19, 2016 4:31:25 PM (8 years ago)
Author:
mark.lam@apple.com
Message:

Replace $vm.printValue() with $vm.value().
https://bugs.webkit.org/show_bug.cgi?id=156767

Reviewed by Saam Barati.

When debugging with $vm, this change allows us to do this:

$vm.print("myObj = " + $vm.value(myObj) + "\n");

... instead of having to do this:

$vm.print("myObj = ");
$vm.printValue(myObj);
$vm.print("\n");

  • tools/JSDollarVMPrototype.cpp:

(JSC::JSDollarVMPrototype::printValue):
(JSC::functionValue):
(JSC::JSDollarVMPrototype::finishCreation):
(JSC::functionPrintValue): Deleted.

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r199734 r199745  
     12016-04-19  Mark Lam  <mark.lam@apple.com>
     2
     3        Replace $vm.printValue() with $vm.value().
     4        https://bugs.webkit.org/show_bug.cgi?id=156767
     5
     6        Reviewed by Saam Barati.
     7
     8        When debugging with $vm, this change allows us to do this:
     9
     10            $vm.print("myObj = " + $vm.value(myObj) + "\n");
     11
     12        ... instead of having to do this:
     13
     14            $vm.print("myObj = ");
     15            $vm.printValue(myObj);
     16            $vm.print("\n");
     17
     18        * tools/JSDollarVMPrototype.cpp:
     19        (JSC::JSDollarVMPrototype::printValue):
     20        (JSC::functionValue):
     21        (JSC::JSDollarVMPrototype::finishCreation):
     22        (JSC::functionPrintValue): Deleted.
     23
    1242016-04-18  Oliver Hunt  <oliver@apple.com>
    225
  • trunk/Source/JavaScriptCore/tools/JSDollarVMPrototype.cpp

    r199076 r199745  
    3434#include "StackVisitor.h"
    3535#include <wtf/DataLog.h>
     36#include <wtf/StringPrintStream.h>
    3637
    3738namespace JSC {
     
    389390}
    390391
    391 static EncodedJSValue JSC_HOST_CALL functionPrintValue(ExecState* exec)
    392 {
     392static EncodedJSValue JSC_HOST_CALL functionValue(ExecState* exec)
     393{
     394    WTF::StringPrintStream stream;
    393395    for (unsigned i = 0; i < exec->argumentCount(); ++i) {
    394396        if (i)
    395             dataLog(" ");
    396         dataLog(exec->uncheckedArgument(i));
    397     }
    398     return JSValue::encode(jsUndefined());
     397            stream.print(", ");
     398        stream.print(exec->uncheckedArgument(i));
     399    }
     400   
     401    return JSValue::encode(jsString(exec, stream.toString()));
    399402}
    400403
     
    421424    addFunction(vm, globalObject, "printStack", functionPrintStack, 0);
    422425
    423     addFunction(vm, globalObject, "printValue", functionPrintValue, 1);
     426    addFunction(vm, globalObject, "value", functionValue, 1);
    424427}
    425428
Note: See TracChangeset for help on using the changeset viewer.