From 700ba1bcb39e082049c96fafdfaccfe5d83cd77e Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 18 Sep 2013 15:34:13 +0200 Subject: Use a StringRef for Managed::get() also store "toString" and "valueOf" as identifiers in the engine and fix two places where we compared strings the wrong way. Change-Id: I70612221e72d43ed0e3c496e4209681bf254cded Reviewed-by: Simon Hausmann --- tools/v4/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/v4/main.cpp b/tools/v4/main.cpp index 3404de2c30..a49245fba9 100644 --- a/tools/v4/main.cpp +++ b/tools/v4/main.cpp @@ -123,7 +123,9 @@ static void showException(QV4::ExecutionContext *ctx, const QV4::Exception &exce if (!e) { std::cerr << "Uncaught exception: " << qPrintable(ex->toString(ctx)->toQString()) << std::endl; } else { - std::cerr << "Uncaught exception: " << qPrintable(QV4::Value::fromReturnedValue(e->get(ctx->engine->newString(QStringLiteral("message")), 0)).toString(ctx)->toQString()) << std::endl; + QV4::ScopedString m(scope, ctx->engine->newString(QStringLiteral("message"))); + QV4::ScopedValue message(scope, e->get(m)); + std::cerr << "Uncaught exception: " << qPrintable(message->toQStringNoThrow()) << std::endl; } foreach (const QV4::ExecutionEngine::StackFrame &frame, exception.stackTrace()) { -- cgit v1.2.3