Skip to content

Commit

Permalink
Fix libGD.wasm not properly loaded on Electron local + build warnings (
Browse files Browse the repository at this point in the history
…#5942)

Don't show in changelog
  • Loading branch information
ClementPasteau authored Nov 23, 2023
1 parent c0c6fdd commit a848764
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Core/GDCore/Events/Builtin/LinkEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
6 changes: 0 additions & 6 deletions Core/GDCore/Events/Parsers/ExpressionParser2.h
Original file line number Diff line number Diff line change
Expand Up @@ -491,11 +491,6 @@ class GD_CORE_API ExpressionParser2 {
std::vector<std::unique_ptr<ExpressionNode>> 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();
Expand All @@ -514,7 +509,6 @@ class GD_CORE_API ExpressionParser2 {
SkipAllWhitespaces();
previousCharacterIsParameterSeparator = CheckIfChar(IsParameterSeparator);
SkipIfChar(IsParameterSeparator);
parameterIndex++;
}

ExpressionParserLocation invalidClosingParenthesisLocation;
Expand Down
2 changes: 0 additions & 2 deletions Core/tests/catch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5398,12 +5398,10 @@ class Runner {
getRegistryHub().getTestCaseRegistry().getFilteredTests(
testSpec, *m_config, testCases);

int testsRunForGroup = 0;
for (std::vector<TestCase>::const_iterator it = testCases.begin(),
itEnd = testCases.end();
it != itEnd;
++it) {
testsRunForGroup++;
if (m_testsAlreadyRun.find(*it) == m_testsAlreadyRun.end()) {
if (context.aborting()) break;

Expand Down
9 changes: 6 additions & 3 deletions newIDE/app/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a848764

Please sign in to comment.