Ignore:
Timestamp:
Feb 20, 2006, 11:43:10 PM (19 years ago)
Author:
ggaren
Message:

Reviewed by Darin, with help from Eric, Maciej.

  • More changes to support super-accurate JS iBench. Doesn't work on Windows. (Doesn't break Windows, either.) I've filed [http://bugzilla. opendarwin.org/show_bug.cgi?id= 7399] about that.
  • kjs/interpreter.cpp: (KJS::Interpreter::evaluate): Print line numbers with exception output
  • kjs/testkjs.cpp: Changed " *" to "* " because Eric says that's the way we roll with .cpp files. (StopWatch::StopWatch): New class. Provides microsecond-accurate timings. (StopWatch::~StopWatch): (StopWatch::start): (StopWatch::stop): (StopWatch::getElapsedMS): (TestFunctionImp::callAsFunction): Added missing return statement. Fixed up "run" to use refactored helper functions. Removed bogus return statement from "quit" case. Made "print" output to stdout instead of stderr because that makes more sense, and PERL handles stdout better. (main): Factored out KXMLCore unit tests. Removed custom exception printing code because the interpreter prints exceptions for you. Added a "delete" call for the GlobalImp we allocate. (testIsInteger): New function, result of refacotring. (createStringWithContentsOfFile): New function, result of refactoring. Renamed "code" to "buffer" to match factored-out-ness.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/interpreter.cpp

    r12317 r12908  
    124124        CString f = sourceURL.UTF8String();
    125125        CString message = comp.value()->toObject(exec)->toString(exec).UTF8String();
     126        int line = comp.value()->toObject(exec)->get(exec, "line")->toUInt32(exec);
    126127#ifdef WIN32
    127                 printf("%s:%s\n", f.c_str(), message.c_str());
     128        printf("%s line %d: %s\n", f.c_str(), line, message.c_str());
    128129#else
    129                 printf("[%d] %s:%s\n", getpid(), f.c_str(), message.c_str());
     130        printf("[%d] %s line %d: %s\n", getpid(), f.c_str(), line, message.c_str());
    130131#endif
    131132    }
Note: See TracChangeset for help on using the changeset viewer.