diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Executable.h b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Executable.h
index d1d38dea6257211fab6fb3ebe0f45789b6731cbe..53945e8c82f66c49f62d81d05d0ad257e6799357 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Executable.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Executable.h
@@ -172,6 +172,8 @@ namespace JSC {
 
         JSObject* compile(ExecState*, ScopeChainNode*);
 
+        bool isCompiled() const { return m_evalCodeBlock; }
+
         ExceptionInfo* reparseExceptionInfo(JSGlobalData*, ScopeChainNode*, CodeBlock*);
         static PassRefPtr<EvalExecutable> create(ExecState* exec, const SourceCode& source) { return adoptRef(new EvalExecutable(exec, source)); }
 
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 6972ddbe58bf25fe48c88ae7733fc0b2ed3a40a7..aa5825f3bcbd39a294d30e0931c86d0e27efc340 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -1366,7 +1366,7 @@ JSC::JSValue QScriptEnginePrivate::evaluateHelper(JSC::ExecState *exec, intptr_t
     q->clearExceptions();
     JSC::DynamicGlobalObjectScope dynamicGlobalObjectScope(exec, exec->scopeChain()->globalObject);
 
-    if (compile) {
+    if (compile && !executable->isCompiled()) {
         JSC::JSObject* error = executable->compile(exec, exec->scopeChain());
         if (error) {
             compile = false;