summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-03-06 20:04:39 +0100
committerLars Knoll <lars.knoll@digia.com>2013-03-06 22:19:32 +0100
commit85e92adeb6a31702a74aeef387423427541ebcf4 (patch)
tree71a56885312ba09b36d4b288a12469fc77513bd3 /tools
parent117455638a555629e82e415312908128280ad72d (diff)
Get rid of 'Value ExecutionEngine::exception' member
Instead the JS exception value is now part of the C++ Exception object. This also allows getting rid of some run-time functions. Change-Id: I43ff773cacd5e925ba96601f3633ccf3b62273be Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/v4/main.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/v4/main.cpp b/tools/v4/main.cpp
index 03ba8285..7238355c 100644
--- a/tools/v4/main.cpp
+++ b/tools/v4/main.cpp
@@ -116,11 +116,11 @@ DEFINE_MANAGED_VTABLE(GC);
} // builtins
-static void showException(QQmlJS::VM::ExecutionContext *ctx)
+static void showException(QQmlJS::VM::ExecutionContext *ctx, const QQmlJS::VM::Value &exception)
{
- QQmlJS::VM::ErrorObject *e = ctx->engine->exception.asErrorObject();
+ QQmlJS::VM::ErrorObject *e = exception.asErrorObject();
if (!e) {
- std::cerr << "Uncaught exception: " << qPrintable(ctx->engine->exception.toString(ctx)->toQString()) << std::endl;
+ std::cerr << "Uncaught exception: " << qPrintable(exception.toString(ctx)->toQString()) << std::endl;
return;
}
@@ -369,7 +369,6 @@ int main(int argc, char *argv[])
const QString code = QString::fromUtf8(file.readAll());
file.close();
- __qmljs_create_exception_handler(ctx);
try {
QQmlJS::VM::Function *f = QQmlJS::VM::EvalFunction::parseSource(ctx, fn, code, QQmlJS::Codegen::GlobalCode,
/*strictMode =*/ false, /*inheritContext =*/ false);
@@ -382,7 +381,7 @@ int main(int argc, char *argv[])
}
} catch (QQmlJS::VM::Exception& ex) {
ex.accept(ctx);
- showException(ctx);
+ showException(ctx, ex.value());
return EXIT_FAILURE;
}