diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-06-17 13:36:21 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2013-06-17 21:20:41 +0200 |
commit | 258c120d820f6d561d97f26ee165ec5c7386fb7b (patch) | |
tree | f7d184ab7cb855f218707541e52e25038412ae0f /tools | |
parent | 530769c9ffd5779ff1eee3c5c9c1372b8ec80330 (diff) |
Make it possible to evaluate JS with the v4 tool the QML way
Change-Id: I2a40e82612c2da1b52a37cbff2507951e4ac0349
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/v4/main.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/v4/main.cpp b/tools/v4/main.cpp index 33c5ad7365..e30fd8d21c 100644 --- a/tools/v4/main.cpp +++ b/tools/v4/main.cpp @@ -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()) { |