From 21d481c209692ec73ab6b6bc43e6977fc2f8c2fc Mon Sep 17 00:00:00 2001 From: Oleg Shparber Date: Wed, 31 Dec 2014 10:43:46 -0800 Subject: Use QV4::ScopedContext typedef instead of actual type Change-Id: I71c6c9cf030e347fbc5e4073e9ca338a9ce95999 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4context.cpp | 10 +++++----- src/qml/jsruntime/qv4debugging.cpp | 8 ++++---- src/qml/jsruntime/qv4engine.cpp | 4 ++-- src/qml/qml/v8/qqmlbuiltinfunctions.cpp | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp index 2857ff8568..f6d27347f6 100644 --- a/src/qml/jsruntime/qv4context.cpp +++ b/src/qml/jsruntime/qv4context.cpp @@ -107,7 +107,7 @@ void ExecutionContext::createMutableBinding(String *name, bool deletable) // find the right context to create the binding on ScopedObject activation(scope, d()->engine->globalObject()); - Scoped ctx(scope, this); + ScopedContext ctx(scope, this); while (ctx) { if (ctx->d()->type >= Heap::ExecutionContext::Type_CallContext) { Heap::CallContext *c = static_cast(ctx->d()); @@ -208,7 +208,7 @@ bool ExecutionContext::deleteProperty(String *name) { Scope scope(this); bool hasWith = false; - Scoped ctx(scope, this); + ScopedContext ctx(scope, this); for (; ctx; ctx = ctx->d()->outer) { if (ctx->d()->type == Heap::ExecutionContext::Type_WithContext) { hasWith = true; @@ -284,7 +284,7 @@ void ExecutionContext::markObjects(Heap::Base *m, ExecutionEngine *engine) void ExecutionContext::setProperty(String *name, const ValueRef value) { Scope scope(this); - Scoped ctx(scope, this); + ScopedContext ctx(scope, this); for (; ctx; ctx = ctx->d()->outer) { if (ctx->d()->type == Heap::ExecutionContext::Type_WithContext) { ScopedObject w(scope, static_cast(ctx->d())->withObject); @@ -349,7 +349,7 @@ ReturnedValue ExecutionContext::getProperty(String *name) bool hasWith = false; bool hasCatchScope = false; - Scoped ctx(scope, this); + ScopedContext ctx(scope, this); for (; ctx; ctx = ctx->d()->outer) { if (ctx->d()->type == Heap::ExecutionContext::Type_WithContext) { ScopedObject w(scope, static_cast(ctx->d())->withObject); @@ -416,7 +416,7 @@ ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Heap::Object ** bool hasWith = false; bool hasCatchScope = false; - Scoped ctx(scope, this); + ScopedContext ctx(scope, this); for (; ctx; ctx = ctx->d()->outer) { if (ctx->d()->type == Heap::ExecutionContext::Type_WithContext) { ScopedObject w(scope, static_cast(ctx->d())->withObject); diff --git a/src/qml/jsruntime/qv4debugging.cpp b/src/qml/jsruntime/qv4debugging.cpp index 22815b8542..85874d1318 100644 --- a/src/qml/jsruntime/qv4debugging.cpp +++ b/src/qml/jsruntime/qv4debugging.cpp @@ -278,7 +278,7 @@ static inline Heap::CallContext *findContext(Heap::ExecutionContext *ctxt, int f return 0; Scope scope(ctxt->engine); - Scoped ctx(scope, ctxt); + ScopedContext ctx(scope, ctxt); while (ctx) { CallContext *cCtxt = ctx->asCallContext(); if (cCtxt && cCtxt->d()->function) { @@ -298,7 +298,7 @@ static inline Heap::CallContext *findScope(Heap::ExecutionContext *ctxt, int sco return 0; Scope s(ctxt->engine); - Scoped ctx(s, ctxt); + ScopedContext ctx(s, ctxt); for (; scope > 0 && ctx; --scope) ctx = ctx->d()->outer; @@ -427,7 +427,7 @@ bool Debugger::collectThisInContext(Debugger::Collector *collector, int frame) bool myRun() { Scope scope(engine); - Scoped ctxt(scope, findContext(engine->currentContext(), frameNr)); + ScopedContext ctxt(scope, findContext(engine->currentContext(), frameNr)); while (ctxt) { if (CallContext *cCtxt = ctxt->asCallContext()) if (cCtxt->d()->activation) @@ -500,7 +500,7 @@ QVector Debugger::getScopeTypes(int frame) if (!sctxt || sctxt->d()->type < Heap::ExecutionContext::Type_SimpleCallContext) return types; - Scoped it(scope, sctxt->d()); + ScopedContext it(scope, sctxt->d()); for (; it; it = it->d()->outer) types.append(it->d()->type); diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index e1e57f9c2d..239a799a29 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -748,7 +748,7 @@ QVector ExecutionEngine::stackTrace(int frameLimit) const ScopedString name(scope); QVector stack; - Scoped c(scope, currentContext()); + ScopedContext c(scope, currentContext()); while (c && frameLimit) { CallContext *callCtx = c->asCallContext(); if (callCtx && callCtx->d()->function) { @@ -838,7 +838,7 @@ QUrl ExecutionEngine::resolvedUrl(const QString &file) QUrl base; Scope scope(this); - Scoped c(scope, currentContext()); + ScopedContext c(scope, currentContext()); while (c) { CallContext *callCtx = c->asCallContext(); if (callCtx && callCtx->d()->function) { diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp index 06c4e6f592..68dabfb203 100644 --- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp +++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp @@ -1691,7 +1691,7 @@ ReturnedValue GlobalExtensions::method_qsTr(CallContext *ctx) int length = lastDot - (lastSlash + 1); context = (lastSlash > -1) ? path.mid(lastSlash + 1, (length > -1) ? length : -1) : QString(); } else if (ctx->d()->parent) { - Scoped parentCtx(scope, ctx->d()->parent); + ScopedContext parentCtx(scope, ctx->d()->parent); // The first non-empty source URL in the call stack determines the translation context. while (parentCtx && context.isEmpty()) { if (QV4::CompiledData::CompilationUnit *unit = parentCtx->d()->compilationUnit) { -- cgit v1.2.3