History

* Update per CR feedback / code standards * Cull log spam * Add tryLock to deferred processor to preempt unnecessary loadEntityContent round-trips

humbletim committed 9 years ago

Commit 417587d1 parent b1595625 files · +32 −27Browse files

Showing the changes to libraries/script-engine/src/BaseScriptEngine.cpp (1 of 5 files). Show all

Unified · Split

libraries/script-engine/src/BaseScriptEngine.cpp+8−10
@@ -118,14 +118,14 @@ QScriptValue BaseScriptEngine::cloneUncaughtException(const QString& extraDetail · 117 unmodified lines
118118 }
119119 if (fileName.isEmpty()) {
120120 // 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 };
123123 if (!info.fileName().isEmpty()) {
124124 // take fileName:lineNumber as a pair
125125 fileName = info.fileName();
126126 lineNumber = info.lineNumber();
127127 if (backtrace.isEmpty()) {
128− backtrace = ctx->backtrace();
128+ backtrace = c->backtrace();
129129 }
130130 break;
131131 }
@@ -181,8 +181,6 @@ QScriptValue BaseScriptEngine::evaluateInClosure(const QScriptValue& closure, co · 49 unmodified lines
181181 return QScriptValue();
182182 }
183183
184− //_debugDump("evaluateInClosure.closure", closure);
185−
186184 const auto fileName = program.fileName();
187185 const auto shortName = QUrl(fileName).fileName();
188186
@@ -197,17 +195,17 @@ QScriptValue BaseScriptEngine::evaluateInClosure(const QScriptValue& closure, co · 8 unmodified lines
197195 setGlobalObject(global);
198196 }
199197
200− auto ctx = pushContext();
198+ auto context = pushContext();
201199
202200 auto thiz = closure.property("this");
203201 if (thiz.isObject()) {
204202 #ifdef DEBUG_JS
205203 qCDebug(scriptengine) << " setting this = closure.this" << shortName;
206204 #endif
207− ctx->setThisObject(thiz);
205+ context->setThisObject(thiz);
208206 }
209207
210− ctx->pushScope(closure);
208+ context->pushScope(closure);
211209 #ifdef DEBUG_JS
212210 qCDebug(scriptengine) << QString("[%1] evaluateInClosure %2").arg(isEvaluating()).arg(shortName);
213211 #endif
@@ -244,8 +242,8 @@ QScriptValue BaseScriptEngine::newLambdaFunction(std::function<QScriptValue(QScr · 30 unmodified lines
244242 auto lambda = new Lambda(this, operation, data);
245243 auto object = newQObject(lambda, ownership);
246244 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
249247 return call;
250248 }
251249 QString Lambda::toString() const {