diff --git a/test-app/runtime/src/main/cpp/ModuleInternal.cpp b/test-app/runtime/src/main/cpp/ModuleInternal.cpp index 07f2588cd..a7779cc50 100644 --- a/test-app/runtime/src/main/cpp/ModuleInternal.cpp +++ b/test-app/runtime/src/main/cpp/ModuleInternal.cpp @@ -23,6 +23,8 @@ #include #include #include +#include +#include using namespace v8; using namespace std; @@ -478,8 +480,9 @@ ScriptCompiler::CachedData* ModuleInternal::TryLoadScriptCache(const std::string auto cacheLastModifiedTime = result.st_mtime; if (stat(path.c_str(), &result) == 0) { auto jsLastModifiedTime = result.st_mtime; - if (jsLastModifiedTime > 0 && cacheLastModifiedTime > 0 && jsLastModifiedTime > cacheLastModifiedTime) { - // The javascript file is more recent than the cache file => ignore the cache + if (jsLastModifiedTime != cacheLastModifiedTime) { + // files have different dates, ignore the cache file (this is enforced by the + // SaveScriptCache function) return nullptr; } } @@ -508,6 +511,16 @@ void ModuleInternal::SaveScriptCache(const Local