Skip to content

Commit a9577a9

Browse files
committed
One test fixed
1 parent a8c525d commit a9577a9

File tree

3 files changed

+6
-23
lines changed

3 files changed

+6
-23
lines changed

docs/index.js

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

docs/index.js.map

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

test/integration/interpreter/micropython/custom-hooks.html

+4-5
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
hooks: {
1313
main: {
1414
onReady: ({ run, runAsync }, element) => {
15+
const isAsync = element.getAttribute('async') !== 'false';
1516
console.log('onMainReady');
1617
dispatchEvent(new Event('mpy:ready'));
17-
const exec = element.hasAttribute('async') ? runAsync : run;
18+
const exec = isAsync ? runAsync : run;
1819
exec(element.textContent.trim());
1920
},
2021
onWorker: () => console.log('onWorkerMain'),
@@ -70,10 +71,8 @@
7071
const isScript = type === 'script';
7172
const tag = document.createElement(isScript ? 'script' : type + '-script');
7273
if (isScript) tag.type = 'mpy';
73-
if (current.async) {
74-
type += '-async';
75-
tag.setAttribute('async', '');
76-
}
74+
if (current.async) type += '-async';
75+
else tag.setAttribute('async', 'false');
7776
if (current.worker) {
7877
type += '-worker';
7978
tag.setAttribute('worker', '');

0 commit comments

Comments
 (0)