Skip to content

Commit

Permalink
One test fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
WebReflection committed Aug 5, 2024
1 parent a8c525d commit a9577a9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 23 deletions.
10 changes: 1 addition & 9 deletions docs/index.js

Large diffs are not rendered by default.

10 changes: 1 addition & 9 deletions docs/index.js.map

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions test/integration/interpreter/micropython/custom-hooks.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
hooks: {
main: {
onReady: ({ run, runAsync }, element) => {
const isAsync = element.getAttribute('async') !== 'false';
console.log('onMainReady');
dispatchEvent(new Event('mpy:ready'));
const exec = element.hasAttribute('async') ? runAsync : run;
const exec = isAsync ? runAsync : run;
exec(element.textContent.trim());
},
onWorker: () => console.log('onWorkerMain'),
Expand Down Expand Up @@ -70,10 +71,8 @@
const isScript = type === 'script';
const tag = document.createElement(isScript ? 'script' : type + '-script');
if (isScript) tag.type = 'mpy';
if (current.async) {
type += '-async';
tag.setAttribute('async', '');
}
if (current.async) type += '-async';
else tag.setAttribute('async', 'false');
if (current.worker) {
type += '-worker';
tag.setAttribute('worker', '');
Expand Down

0 comments on commit a9577a9

Please sign in to comment.