Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/script/api/qscriptcontextinfo.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    5454
    5555  If the called function is executing Qt Script code, you can obtain
    56   the script location with the functions fileName(), lineNumber() and
    57   columnNumber().
     56  the script location with the functions fileName() and lineNumber().
    5857
    5958  You can obtain the starting line number and ending line number of a
     
    159158            JSC::Instruction *returnPC = rewindContext->returnPC();
    160159            JSC::CodeBlock *codeBlock = frame->codeBlock();
    161             if (returnPC && codeBlock) {
     160            if (returnPC && codeBlock) {
    162161#if ENABLE(JIT)
    163162                unsigned bytecodeOffset = codeBlock->getBytecodeIndex(frame, JSC::ReturnAddressPtr(returnPC));
     
    173172    // Get the filename and the scriptId:
    174173    JSC::CodeBlock *codeBlock = frame->codeBlock();
    175     if (codeBlock) {
     174    if (codeBlock) {
    176175           JSC::SourceProvider *source = codeBlock->source();
    177176           scriptId = source->asID();
     
    179178    }
    180179
    181     // Get the others informations:
     180    // Get the others information:
    182181    JSC::JSObject *callee = frame->callee();
    183182    if (callee && callee->inherits(&JSC::InternalFunction::info))
    184         functionName = JSC::asInternalFunction(callee)->name(&frame->globalData());
    185     if (callee && callee->inherits(&JSC::JSFunction::info)) {
     183        functionName = JSC::asInternalFunction(callee)->name(frame);
     184    if (callee && callee->inherits(&JSC::JSFunction::info)
     185        && !JSC::asFunction(callee)->isHostFunction()) {
    186186        functionType = QScriptContextInfo::ScriptFunction;
    187187        JSC::FunctionExecutable *body = JSC::asFunction(callee)->jsExecutable();
     
    318318
    319319/*!
    320   Returns the column number corresponding to the statement being
    321   executed, or -1 if the column number is not available.
    322 
    323   The column number is only available if Qt Script code is being
    324   executed.
    325 
    326   \sa lineNumber(), fileName()
     320  \obsolete
    327321*/
    328322int QScriptContextInfo::columnNumber() const
Note: See TracChangeset for help on using the changeset viewer.