Showing the changes to libraries/script-engine/src/BaseScriptEngine.cpp (1 of 5 files). Show all
Unified · Split
| @@ -118,14 +118,14 @@ QScriptValue BaseScriptEngine::cloneUncaughtException(const QString& extraDetail · 117 unmodified lines | ||
| 118 | 118 | } |
| 119 | 119 | if (fileName.isEmpty()) { |
| 120 | 120 | // climb the stack frames looking for something useful to display |
| 121 | − for(auto ctx = currentContext(); ctx && fileName.isEmpty(); ctx = ctx->parentContext()) { | |
| 122 | − QScriptContextInfo info { ctx }; | |
| 121 | + for (auto c = currentContext(); c && fileName.isEmpty(); c = c->parentContext()) { | |
| 122 | + QScriptContextInfo info { c }; | |
| 123 | 123 | if (!info.fileName().isEmpty()) { |
| 124 | 124 | // take fileName:lineNumber as a pair |
| 125 | 125 | fileName = info.fileName(); |
| 126 | 126 | lineNumber = info.lineNumber(); |
| 127 | 127 | if (backtrace.isEmpty()) { |
| 128 | − backtrace = ctx->backtrace(); | |
| 128 | + backtrace = c->backtrace(); | |
| 129 | 129 | } |
| 130 | 130 | break; |
| 131 | 131 | } |
| @@ -181,8 +181,6 @@ QScriptValue BaseScriptEngine::evaluateInClosure(const QScriptValue& closure, co · 49 unmodified lines | ||
| 181 | 181 | return QScriptValue(); |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | − //_debugDump("evaluateInClosure.closure", closure); | |
| 185 | − | |
| 186 | 184 | const auto fileName = program.fileName(); |
| 187 | 185 | const auto shortName = QUrl(fileName).fileName(); |
| 188 | 186 | |
| @@ -197,17 +195,17 @@ QScriptValue BaseScriptEngine::evaluateInClosure(const QScriptValue& closure, co · 8 unmodified lines | ||
| 197 | 195 | setGlobalObject(global); |
| 198 | 196 | } |
| 199 | 197 | |
| 200 | − auto ctx = pushContext(); | |
| 198 | + auto context = pushContext(); | |
| 201 | 199 | |
| 202 | 200 | auto thiz = closure.property("this"); |
| 203 | 201 | if (thiz.isObject()) { |
| 204 | 202 | #ifdef DEBUG_JS |
| 205 | 203 | qCDebug(scriptengine) << " setting this = closure.this" << shortName; |
| 206 | 204 | #endif |
| 207 | − ctx->setThisObject(thiz); | |
| 205 | + context->setThisObject(thiz); | |
| 208 | 206 | } |
| 209 | 207 | |
| 210 | − ctx->pushScope(closure); | |
| 208 | + context->pushScope(closure); | |
| 211 | 209 | #ifdef DEBUG_JS |
| 212 | 210 | qCDebug(scriptengine) << QString("[%1] evaluateInClosure %2").arg(isEvaluating()).arg(shortName); |
| 213 | 211 | #endif |
| @@ -244,8 +242,8 @@ QScriptValue BaseScriptEngine::newLambdaFunction(std::function<QScriptValue(QScr · 30 unmodified lines | ||
| 244 | 242 | auto lambda = new Lambda(this, operation, data); |
| 245 | 243 | auto object = newQObject(lambda, ownership); |
| 246 | 244 | auto call = object.property("call"); |
| 247 | − call.setPrototype(object); // ctx->callee().prototype() === Lambda QObject | |
| 248 | − call.setData(data); // ctx->callee().data() will === data param | |
| 245 | + call.setPrototype(object); // context->callee().prototype() === Lambda QObject | |
| 246 | + call.setData(data); // context->callee().data() will === data param | |
| 249 | 247 | return call; |
| 250 | 248 | } |
| 251 | 249 | QString Lambda::toString() const { |