simon-git: puzzles (main): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Thu Apr 22 21:35:53 BST 2021
TL;DR:
77866e1 wasm/js/emscripten: Fix page loading race
Repository: https://git.tartarus.org/simon/puzzles.git
On the web: https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: main
Committer: Simon Tatham <anakin at pobox.com>
Date: 2021-04-22 21:35:53
commit 77866e1335bd1ea7189f11c19ff2947be17aa517
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=77866e1335bd1ea7189f11c19ff2947be17aa517;hp=56ef86f92b77412bfe27d7206d25b323475e71fe
Author: Ian Jackson <ijackson at chiark.greenend.org.uk>
Date: Thu Apr 22 19:20:32 2021 +0100
wasm/js/emscripten: Fix page loading race
Using a stunt webserver which artificially introduces a 3s delay just
before the last line of the HTML output, I have reproduced a
uwer-reported loading/startup race bug:
Previously the wasm loading was started by the <script> element,
synchronously. If the wasm loading is fast, and finishes before the
HTML loading, the onRuntimeInitialized event may occur before
initPuzzles. But initPuzzles sets up the event handler.
Fix this bug, and introduce a new comment containing an argument for
the correctness of the new approach.
Signed-off-by: Ian Jackson <ijackson at chiark.greenend.org.uk>
cmake/platforms/emscripten.cmake | 1 +
emccpost.js | 1 +
emccpre.js | 45 ++++++++++++++++++++++++++++++++++++++++
html/jspage.pl | 4 ++--
4 files changed, 49 insertions(+), 2 deletions(-)
More information about the tartarus-commits
mailing list