Require async

This commit is contained in:
2026-06-06 10:55:10 -05:00
parent 9068d96130
commit 81024c4c09
8 changed files with 362 additions and 108 deletions
+6 -19
View File
@@ -10,24 +10,11 @@ const platformNames = {
Console.print('Platform: ' + (platformNames[System.platform] || 'Unknown'));
// Testing async/await
async function testAsync() {
Console.print('Testing async/await...');
await frame();
Console.print('First await done!');
await timeout(1000);
Console.print('Async/await works!');
async function testRequireAsync() {
Console.print('Loading testscene.js...');
const scene = await requireAsync('testscene.js');
Console.print('Loaded!');
Console.print(scene.test());
}
testAsync();
// Scene.set('testscene.js');
// Console.print('Loading scene...');
// requireAsync('./testscene.js', function(scene) {
// throw "test";
// Console.print('Initializing scene...');
// var batch = scene.load();
// batch.lock();
// batch.requireLoaded();
// scene.init();
// });
testRequireAsync();