From 85e92adeb6a31702a74aeef387423427541ebcf4 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 6 Mar 2013 20:04:39 +0100 Subject: 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 --- tools/v4/main.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'tools') 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; } -- cgit v1.2.3