Skip to content

Commit a5a3afb

Browse files
committed
fixed an issue with the currentScript not spotted before
1 parent 45754df commit a5a3afb

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

docs/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

esm/script-handler.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ const execute = async (currentScript, source, XWorker, isAsync) => {
6969
workers: workersHandler,
7070
});
7171
dispatch(currentScript, type, 'ready');
72-
const result = module[isAsync ? 'runAsync' : 'run'](interpreter, content);
72+
let result = module[isAsync ? 'runAsync' : 'run'](interpreter, content);
7373
const done = dispatch.bind(null, currentScript, type, 'done');
74-
if (isAsync) result.then(done);
75-
else done();
74+
if (isAsync) result = await result;
75+
done();
7676
return result;
7777
} finally {
7878
delete document.currentScript;

0 commit comments

Comments
 (0)