This commit is contained in:
Evan
2026-09-07 09:55:36 +08:00
parent 9b6892f2ed
commit badbc11154
9098 changed files with 985321 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
const Runtime = require('../../src/engine/runtime');
const Sprite = require('../../src/sprites/sprite');
const {test} = require('tap');
test('clone counter', t => {
const rt = new Runtime();
const sprite = new Sprite(null, rt);
const original = sprite.createClone();
t.equal(rt._cloneCounter, 0);
const clone = original.makeClone();
t.equal(rt._cloneCounter, 1);
clone.dispose();
t.equal(rt._cloneCounter, 0);
original.dispose();
t.equal(rt._cloneCounter, 0);
t.end();
});