From a848764318f71c6a60175851f7d5b9f56e418003 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pasteau?= <4895034+ClementPasteau@users.noreply.github.com> Date: Thu, 23 Nov 2023 15:55:31 +0100 Subject: [PATCH] Fix libGD.wasm not properly loaded on Electron local + build warnings (#5942) Don't show in changelog --- Core/GDCore/Events/Builtin/LinkEvent.cpp | 2 +- Core/GDCore/Events/Parsers/ExpressionParser2.h | 6 ------ Core/tests/catch.hpp | 2 -- newIDE/app/src/index.js | 9 ++++++--- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Core/GDCore/Events/Builtin/LinkEvent.cpp b/Core/GDCore/Events/Builtin/LinkEvent.cpp index e104f0823465..d2285081dc87 100644 --- a/Core/GDCore/Events/Builtin/LinkEvent.cpp +++ b/Core/GDCore/Events/Builtin/LinkEvent.cpp @@ -164,7 +164,7 @@ void LinkEvent::UnserializeFrom(gd::Project& project, } bool LinkEvent::AcceptVisitor(gd::EventVisitor &eventVisitor) { - return BaseEvent::AcceptVisitor(eventVisitor) | + return BaseEvent::AcceptVisitor(eventVisitor) || eventVisitor.VisitLinkEvent(*this); } diff --git a/Core/GDCore/Events/Parsers/ExpressionParser2.h b/Core/GDCore/Events/Parsers/ExpressionParser2.h index 7b1915a556de..08e299964a04 100644 --- a/Core/GDCore/Events/Parsers/ExpressionParser2.h +++ b/Core/GDCore/Events/Parsers/ExpressionParser2.h @@ -491,11 +491,6 @@ class GD_CORE_API ExpressionParser2 { std::vector> parameters; gd::String lastObjectName = ""; - // By convention, object is always the first parameter, and behavior the - // second one. - size_t parameterIndex = - WrittenParametersFirstIndex(objectName, behaviorName); - bool previousCharacterIsParameterSeparator = false; while (!IsEndReached()) { SkipAllWhitespaces(); @@ -514,7 +509,6 @@ class GD_CORE_API ExpressionParser2 { SkipAllWhitespaces(); previousCharacterIsParameterSeparator = CheckIfChar(IsParameterSeparator); SkipIfChar(IsParameterSeparator); - parameterIndex++; } ExpressionParserLocation invalidClosingParenthesisLocation; diff --git a/Core/tests/catch.hpp b/Core/tests/catch.hpp index 1f904bb4588f..9f0dddb6cd5a 100644 --- a/Core/tests/catch.hpp +++ b/Core/tests/catch.hpp @@ -5398,12 +5398,10 @@ class Runner { getRegistryHub().getTestCaseRegistry().getFilteredTests( testSpec, *m_config, testCases); - int testsRunForGroup = 0; for (std::vector::const_iterator it = testCases.begin(), itEnd = testCases.end(); it != itEnd; ++it) { - testsRunForGroup++; if (m_testsAlreadyRun.find(*it) == m_testsAlreadyRun.end()) { if (context.aborting()) break; diff --git a/newIDE/app/src/index.js b/newIDE/app/src/index.js index 39a7faeb780f..a6bee9de25da 100644 --- a/newIDE/app/src/index.js +++ b/newIDE/app/src/index.js @@ -95,9 +95,12 @@ class Bootstrapper extends Component<{}, State> { // Override the resolved URL for the .wasm file, // to ensure a new version is fetched when the version changes. locateFile: (path: string, prefix: string) => { - return ( - prefix + path + `?cache-buster=${VersionMetadata.versionWithHash}` - ); + // This function is called by Emscripten to locate the .wasm file only. + // As the wasm is at the root of the public folder, we can just return + // the path to the file. + // Plus, on Electron, the prefix seems to be pointing to the root of the + // app.asar archive, which is completely wrong. + return path + `?cache-buster=${VersionMetadata.versionWithHash}`; }, }).then(gd => { global.gd = gd;