Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

fix(gates): an export only the editor calls is not an export nobody calls

esengine1c4a9a5c1410
diff --git a/tools/check-engine-exports.mjs b/tools/check-engine-exports.mjs
index f8c2eb2f9..eaee8a805 100644
--- a/tools/check-engine-exports.mjs
+++ b/tools/check-engine-exports.mjs
@@ -44,7 +44,14 @@ const unreachable = exported.filter((name) => {
return !texts.some((t) => re.test(t));
});
-if (unreachable.length > 0) {
+// Without the editor's sources an export the inspector alone calls looks dead —
+// the profiler's scope readers are exactly that. A verdict this checkout cannot
+// reach is not a defect: report it, and leave it to a run that sees both sides.
+if (unreachable.length > 0 && missing.length) {
+ console.log(`check-engine-exports: ${unreachable.length} export(s) have no caller in the sources`
+ + ' scanned here; an editor checkout is needed to judge them:');
+ for (const n of unreachable) console.log(` ${n}`);
+} else if (unreachable.length > 0) {
console.error(`${unreachable.length} engine export(s) no host calls:\n`);
for (const n of unreachable) console.error(` ${n}`);
console.error(`\nEither wire it up or drop it from ${ENTRY}: an export with no caller`
@@ -52,5 +59,6 @@ if (unreachable.length > 0) {
process.exit(1);
}
-console.log(`check-engine-exports: ${exported.length} export(s), every one of them reachable`
+const judged = exported.length - unreachable.length;
+console.log(`check-engine-exports: ${judged} of ${exported.length} export(s) reachable`
+ ` (${byName.size} through the generated pointer table).`);