Changeset 846 for trunk/src/script/api/qscriptcontextinfo.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/script/api/qscriptcontextinfo.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 54 54 55 55 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(). 58 57 59 58 You can obtain the starting line number and ending line number of a … … 159 158 JSC::Instruction *returnPC = rewindContext->returnPC(); 160 159 JSC::CodeBlock *codeBlock = frame->codeBlock(); 161 if (returnPC && codeBlock ) {160 if (returnPC && codeBlock) { 162 161 #if ENABLE(JIT) 163 162 unsigned bytecodeOffset = codeBlock->getBytecodeIndex(frame, JSC::ReturnAddressPtr(returnPC)); … … 173 172 // Get the filename and the scriptId: 174 173 JSC::CodeBlock *codeBlock = frame->codeBlock(); 175 if (codeBlock ) {174 if (codeBlock) { 176 175 JSC::SourceProvider *source = codeBlock->source(); 177 176 scriptId = source->asID(); … … 179 178 } 180 179 181 // Get the others information s:180 // Get the others information: 182 181 JSC::JSObject *callee = frame->callee(); 183 182 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()) { 186 186 functionType = QScriptContextInfo::ScriptFunction; 187 187 JSC::FunctionExecutable *body = JSC::asFunction(callee)->jsExecutable(); … … 318 318 319 319 /*! 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 327 321 */ 328 322 int QScriptContextInfo::columnNumber() const
Note:
See TracChangeset
for help on using the changeset viewer.