| 2135 | } |
| 2136 | |
| 2137 | void JavascriptProcessor::stuffAfterCompilation(const SnippetResult& result) |
| 2138 | { |
| 2139 | |
| 2140 | |
| 2141 | mainController->getScriptComponentEditBroadcaster()->clearSelection(sendNotification); |
| 2142 | |
| 2143 | if (lastCompileWasOK && lastOptimisationReport.isNotEmpty()) |
| 2144 | { |
| 2145 | debugToConsole(dynamic_cast<Processor*>(this), lastOptimisationReport); |
| 2146 | |
| 2147 | String x; |
| 2148 | mergeCallbacksToScript(x); |
| 2149 | } |
| 2150 | |
| 2151 | mainController->checkAndAbortMessageThreadOperation(); |
| 2152 | |
| 2153 | #if USE_BACKEND |
| 2154 | if (isConnectedToExternalFile()) |
| 2155 | { |
| 2156 | auto shouldSave = (bool)GET_HISE_SETTING(dynamic_cast<Processor*>(this), HiseSettings::Scripting::SaveConnectedFilesOnCompile); |
| 2157 | |
| 2158 | if (shouldSave) |
| 2159 | { |
| 2160 | String x; |
| 2161 | mergeCallbacksToScript(x); |
| 2162 | |
| 2163 | const File f = GET_PROJECT_HANDLER(dynamic_cast<const Processor*>(this)).getFilePath(connectedFileReference, ProjectHandler::SubDirectories::Scripts); |
| 2164 | |
| 2165 | f.replaceWithText(x); |
| 2166 | } |
| 2167 | } |
| 2168 | #endif |
| 2169 | |
| 2170 | |
| 2171 | clearFileWatchers(); |
| 2172 | |
| 2173 | const int numFiles = scriptEngine->getNumIncludedFiles(); |
| 2174 | |
| 2175 | for (int i = 0; i < numFiles; i++) |
| 2176 | { |
| 2177 | mainController->checkAndAbortMessageThreadOperation(); |
| 2178 | |
| 2179 | addFileWatcher(scriptEngine->getIncludedFile(i)); |
| 2180 | setFileResult(scriptEngine->getIncludedFile(i), scriptEngine->getIncludedFileResult(i)); |
| 2181 | } |
| 2182 | |
| 2183 | const String fileName = ApiHelpers::getFileNameFromErrorMessage(result.r.getErrorMessage()); |
| 2184 | |
| 2185 | if (fileName.isNotEmpty()) |
| 2186 | { |
| 2187 | for (int i = 0; i < getNumWatchedFiles(); i++) |
| 2188 | { |
| 2189 | mainController->checkAndAbortMessageThreadOperation(); |
| 2190 | |
| 2191 | if (getWatchedFile(i).getFileName() == fileName) |
| 2192 | { |
| 2193 | setFileResult(getWatchedFile(i), result.r); |
| 2194 | } |
no test coverage detected