Defaulting to async for top-level await (#2134)

This commit is contained in:
Andrea Giammarchi
2024-08-05 15:55:53 +02:00
committed by GitHub
parent fafdf74007
commit 0d0ea96435
8 changed files with 37 additions and 609 deletions

View File

@@ -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>