Make it possible to evaluate JS with the v4 tool the QML way

Change-Id: I2a40e82612c2da1b52a37cbff2507951e4ac0349
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
Simon Hausmann 2013-06-17 13:36:21 +02:00 committed by Lars Knoll
parent 530769c9ff
commit 258c120d82
1 changed files with 7 additions and 0 deletions

View File

@ -282,6 +282,7 @@ int main(int argc, char *argv[])
QQmlJS::LLVMOutputType fileType = QQmlJS::LLVMOutputObject;
#endif // QMLJS_WITH_LLVM
bool enableDebugging = false;
bool runAsQml = false;
if (!args.isEmpty()) {
if (args.first() == QLatin1String("-d") || args.first() == QLatin1String("--debug")) {
@ -301,6 +302,11 @@ int main(int argc, char *argv[])
args.removeFirst();
}
if (args.first() == QLatin1String("--qml")) {
runAsQml = true;
args.removeFirst();
}
#ifdef QMLJS_WITH_LLVM
if (args.first() == QLatin1String("--compile")) {
mode = use_llvm_compiler;
@ -388,6 +394,7 @@ int main(int argc, char *argv[])
try {
QV4::Script script(ctx, code, fn);
script.parseAsBinding = runAsQml;
script.parse();
QV4::Value result = script.run();
if (!result.isUndefined()) {