Initial commit of 001code-html Scratch frontend project.

Includes scratch-gui, scratch-vm, scratch-blocks, scratch-render, scratch-l10n, and deployment config.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-16 15:37:45 +08:00
commit 6e0a1fbcbb
11350 changed files with 965674 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
const test = require('tap').test;
const Clock = require('../../src/io/clock');
const Runtime = require('../../src/engine/runtime');
test('spec', t => {
const rt = new Runtime();
const c = new Clock(rt);
t.type(Clock, 'function');
t.type(c, 'object');
t.type(c.projectTimer, 'function');
t.type(c.pause, 'function');
t.type(c.resume, 'function');
t.type(c.resetProjectTimer, 'function');
t.end();
});
test('cycle', t => {
const rt = new Runtime();
const c = new Clock(rt);
t.ok(c.projectTimer() <= 0.1);
setTimeout(() => {
c.resetProjectTimer();
setTimeout(() => {
// The timer shouldn't advance until all threads have been stepped
t.ok(c.projectTimer() === 0);
c.pause();
t.ok(c.projectTimer() === 0);
c.resume();
t.ok(c.projectTimer() === 0);
t.end();
}, 100);
}, 100);
rt._step();
t.ok(c.projectTimer() > 0);
});