mirror of
https://github.com/pyscript/pyscript.git
synced 2026-02-22 14:01:31 -05:00
Defaulting to async for top-level await (#2134)
This commit is contained in:
committed by
GitHub
parent
fafdf74007
commit
0d0ea96435
@@ -5,11 +5,17 @@
|
||||
<script type="module" src="../dist/core.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<py-script async>
|
||||
<py-script>
|
||||
import asyncio
|
||||
print('foo')
|
||||
print('py-script sleep')
|
||||
await asyncio.sleep(1)
|
||||
print('bar')
|
||||
print('py-script done')
|
||||
</py-script>
|
||||
<script type="py">
|
||||
import asyncio
|
||||
print('script-py sleep')
|
||||
await asyncio.sleep(1)
|
||||
print('script-py done')
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -48,12 +48,12 @@
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<script type="mpy" worker>
|
||||
<script type="mpy" async="false" worker>
|
||||
from pyscript import document
|
||||
print("actual code in worker")
|
||||
document.documentElement.classList.add('worker')
|
||||
</script>
|
||||
<script type="mpy">
|
||||
<script type="mpy" async="false">
|
||||
print("actual code in main")
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user