- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/scripttools/debugging/qscriptdebuggerbackend.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the QtSCriptTools module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 132 132 133 133 QScriptDebuggerBackendPrivate::QScriptDebuggerBackendPrivate() 134 { 135 eventReceiver = 0; 136 agent = 0; 137 commandExecutor = 0; 138 pendingEvaluateLineNumber = -1; 139 ignoreExceptions = false; 140 nextScriptValueIteratorId = 0; 141 nextScriptObjectSnapshotId = 0; 134 : agent(0), commandExecutor(0), 135 pendingEvaluateContextIndex(-1), pendingEvaluateLineNumber(-1), 136 ignoreExceptions(false), 137 nextScriptValueIteratorId(0), nextScriptObjectSnapshotId(0), 138 eventReceiver(0), 139 q_ptr(0) // q_ptr will be set later by QScriptDebuggerBackend constructor 140 { 142 141 } 143 142 … … 293 292 for (int i = 0; i < context->argumentCount(); ++i) { 294 293 if (i > 0) 295 str.append(QLatin1 String(" "));294 str.append(QLatin1)); 296 295 str.append(context->argument(i).toString()); 297 296 } … … 386 385 { 387 386 detach(); 388 delete d_ptr;389 387 } 390 388 … … 413 411 d->agent = new QScriptDebuggerAgent(d, engine); 414 412 QScriptValue global = engine->globalObject(); 413 415 414 global.setProperty(QString::fromLatin1("print"), traceFunction()); 416 415 // global.setProperty(QString::fromLatin1("qAssert"), assertFunction()); 416 417 417 global.setProperty(QString::fromLatin1("__FILE__"), fileNameFunction(), 418 QScriptValue::PropertyGetter | QScriptValue:: PropertySetter419 | QScriptValue::ReadOnly);418 QScriptValue::PropertyGetter | QScriptValue:: 419 ); 420 420 global.setProperty(QString::fromLatin1("__LINE__"), lineNumberFunction(), 421 QScriptValue::PropertyGetter | QScriptValue::PropertySetter 422 | QScriptValue::ReadOnly); 421 QScriptValue::PropertyGetter | QScriptValue::ReadOnly); 423 422 engine->setAgent(d->agent); 424 423 } … … 434 433 { 435 434 Q_D(QScriptDebuggerBackend); 436 if (!d->agent) 437 return; 438 QScriptEngine *eng = d->agent->engine(); 439 if (eng && eng->agent() == d->agent) { 440 eng->setAgent(0); 441 QScriptValue global = eng->globalObject(); 442 if (global.property(QString::fromLatin1("print")).strictlyEquals(traceFunction())) 443 global.setProperty(QString::fromLatin1("print"), QScriptValue()); 444 // global.setProperty(QString::fromLatin1("qAssert"), QScriptValue()); 445 if (global.property(QString::fromLatin1("__FILE__")).strictlyEquals(fileNameFunction())) 446 global.setProperty(QString::fromLatin1("__FILE__"), QScriptValue()); 447 if (global.property(QString::fromLatin1("__LINE__")).strictlyEquals(lineNumberFunction())) 448 global.setProperty(QString::fromLatin1("__LINE__"), QScriptValue()); 449 d->agent->nullifyBackendPointer(); 450 d->agent = 0; // agent is owned by engine 435 if (d->agent) { 436 QScriptEngine *eng = d->agent->engine(); 437 if (eng && eng->agent() == d->agent) { 438 eng->setAgent(0); 439 QScriptValue global = eng->globalObject(); 440 global.setProperty(QString::fromLatin1("print"), d->origTraceFunction); 441 d->origTraceFunction = QScriptValue(); 442 // global.setProperty(QString::fromLatin1("qAssert"), QScriptValue()); 443 global.setProperty(QString::fromLatin1("__FILE__"), QScriptValue(), 444 QScriptValue::PropertyGetter); 445 global.setProperty(QString::fromLatin1("__FILE__"), d->origFileNameFunction); 446 d->origFileNameFunction = QScriptValue(); 447 global.setProperty(QString::fromLatin1("__LINE__"), QScriptValue(), 448 QScriptValue::PropertyGetter); 449 global.setProperty(QString::fromLatin1("__LINE__"), d->origLineNumberFunction); 450 d->origLineNumberFunction = QScriptValue(); 451 d->agent->nullifyBackendPointer(); 452 d->agent = 0; // agent is owned by engine 453 } 451 454 } 452 455 … … 616 619 { 617 620 QScriptContext *evalContext = engine()->pushContext(); 618 #if QT_VERSION >= 0x040500619 621 QScriptValueList scopeChain = ctx->scopeChain(); 620 622 if (scopeChain.isEmpty()) … … 622 624 while (!scopeChain.isEmpty()) 623 625 evalContext->pushScope(scopeChain.takeLast()); 624 #endif625 626 evalContext->setActivationObject(ctx->activationObject()); 626 627 evalContext->setThisObject(ctx->thisObject()); … … 805 806 if (!engine()) 806 807 return 0; 807 int count = 0; 808 QScriptContext *ctx = engine()->currentContext(); 809 while (ctx) { 810 ++count; 811 ctx = ctx->parentContext(); 812 } 813 return count; 808 return contextIds().count(); 814 809 } 815 810
Note:
See TracChangeset
for help on using the changeset viewer.