[tool] Fix flutter.js regression with hot-reload on promise-based init. (#110805)

This commit is contained in:
David Iglesias
2022-09-01 15:25:16 -07:00
committed by GitHub
parent 822f6e3595
commit 9cb9f6bca4
5 changed files with 217 additions and 6 deletions

View File

@@ -205,6 +205,8 @@ _flutter.loader = null;
this._didCreateEngineInitializerResolve(engineInitializer);
// Remove the resolver after the first time, so Flutter Web can hot restart.
this._didCreateEngineInitializerResolve = null;
// Make the engine revert to "auto" initialization on hot restart.
delete _flutter.loader.didCreateEngineInitializer;
}
if (typeof this._onEntrypointLoaded === "function") {
this._onEntrypointLoaded(engineInitializer);