Index: /trunk/FACT++/src/InterpreterV8.cc
===================================================================
--- /trunk/FACT++/src/InterpreterV8.cc	(revision 14982)
+++ /trunk/FACT++/src/InterpreterV8.cc	(revision 14983)
@@ -23,5 +23,8 @@
 #include "dim.h"
 #include "tools.h"
+#include "Readline.h"
 #include "externals/izstream.h"
+
+#include "WindowLog.h"
 
 using namespace std;
@@ -1719,10 +1722,12 @@
         // Print (filename):(line number): (message).
         const String::AsciiValue filename(message->GetScriptResourceName());
-
-        out << *filename;
-        if (message->GetLineNumber()>0)
-            out << ": l." << message->GetLineNumber();
-        if (*exception)
-            out << ": ";
+        if (filename.length()>0)
+        {
+            out << *filename;
+            if (message->GetLineNumber()>0)
+                out << ": l." << message->GetLineNumber();
+            if (*exception)
+                out << ": ";
+        }
     }
 
@@ -1843,4 +1848,64 @@
 
     return !ExecuteCode(buffer, name, main).IsEmpty();
+}
+
+bool InterpreterV8::ExecuteConsole()
+{
+    JsSetState(3);
+
+    WindowLog lout;
+    lout << "\n " << kUnderline << " JavaScript interpreter " << kReset << " (enter '.q' to quit)\n" << endl;
+
+    Readline::StaticPushHistory("java.his");
+
+    string command;
+
+    while (1)
+    {
+        const string buffer = Tools::Trim(Readline::StaticPrompt(command.empty() ? "JS> " : " \\> "));
+        if (buffer==".q")
+            break;
+
+        // buffer empty, do nothing
+        if (buffer.empty())
+            continue;
+
+        // Compose command
+        if (!command.empty())
+            command += ' ';
+        command += buffer;
+
+        // If line ends with a backslash, allow addition of next line
+        if (command.back()=='\\')
+        {
+            command[command.length()-1] = ' ';
+            command = Tools::Trim(command);
+            continue;
+        }
+
+        // Catch exceptions during code compilation
+        TryCatch exception;
+
+        // Execute code which was entered
+        bool rc = ExecuteCode(command, "", false).IsEmpty();
+        if (exception.HasCaught())
+        {
+            HandleException(exception, "compile");
+            rc = true;
+        }
+
+        // In case of an exception add an empty line to the output
+        if (rc)
+            lout << endl;
+
+        // command has been executed, collect new command
+        command = "";
+    }
+
+    lout << endl;
+
+    Readline::StaticPopHistory("java.his");
+
+    return true;
 }
 
@@ -2072,5 +2137,5 @@
         Locker::StartPreemption(10);
 
-        rc &= ExecuteFile(filename, true);
+        rc &= filename.empty() ? ExecuteConsole() : ExecuteFile(filename, true);
 
         Locker::StopPreemption();
Index: /trunk/FACT++/src/InterpreterV8.h
===================================================================
--- /trunk/FACT++/src/InterpreterV8.h	(revision 14982)
+++ /trunk/FACT++/src/InterpreterV8.h	(revision 14983)
@@ -57,4 +57,5 @@
     bool HandleException(v8::TryCatch &try_catch, const char *where);
     bool ExecuteFile(const std::string &name, bool main=false);
+    bool ExecuteConsole();
     v8::Handle<v8::Value> ExecuteCode(const std::string &code, const std::string &file="internal", bool main=false);
     v8::Handle<v8::Value> ExecuteInternal(const std::string &code);
