From fed1c5963bd1fbda40d0a1b055b39d57c9f65020 Mon Sep 17 00:00:00 2001 From: cs01 Date: Mon, 9 Mar 2026 00:17:03 -0700 Subject: [PATCH] fix: replace silent null return with compile error for unsupported module method calls --- src/codegen/expressions/method-calls.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/codegen/expressions/method-calls.ts b/src/codegen/expressions/method-calls.ts index 68fa970f..15f25812 100644 --- a/src/codegen/expressions/method-calls.ts +++ b/src/codegen/expressions/method-calls.ts @@ -1043,7 +1043,10 @@ export class MethodCallGenerator { imp.source.startsWith("../") || imp.source.startsWith("/"); if (!isRelative && imp.specifiers && imp.specifiers.indexOf(varName) !== -1) { - return "null"; + return this.ctx.emitError( + `'${varName}.${method}()' — module '${imp.source}' is not supported by ChadScript`, + expr.loc, + ); } } }