Add the 'async' property to the onload function only when necessary
This commit is contained in:
parent
d0dfbe6b1f
commit
ededebe002
1 changed files with 1 additions and 1 deletions
|
|
@ -20,7 +20,7 @@ function register() {
|
|||
//helpUrl: "#fullscreen",
|
||||
}, (block) => {
|
||||
const BLOCKS = javascriptGenerator.statementToCode(block, 'BLOCKS');
|
||||
return `async function onload() {\n${BLOCKS}}`;
|
||||
return `${BLOCKS.indexOf('await') > -1 ? 'async' : ''} function onload() {\n${BLOCKS}}`;
|
||||
})
|
||||
|
||||
// setInterval
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue