From 33391db446b2207d041a189b37328d7165e1e060 Mon Sep 17 00:00:00 2001 From: hackx2 <80620538+hackx2@users.noreply.github.com> Date: Sun, 22 Nov 2026 11:23:32 +0000 Subject: [PATCH 1/2] add `isWildCard` to `importFailedCallback` gonna make a separate pr for CNE to implement fs-based wildcard imports :3 --- hscript/Interp.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hscript/Interp.hx b/hscript/Interp.hx index 17b5f71b..894edc97 100644 --- a/hscript/Interp.hx +++ b/hscript/Interp.hx @@ -146,7 +146,7 @@ class Interp { /** * Custom Import resolver. It's called when an import couldn't be resolved. */ - public var importFailedCallback:Array->Null->Bool; + public var importFailedCallback:Array->Null->?Bool->Bool; public var customClasses:Map; public var variables:Map; @@ -978,7 +978,7 @@ class Interp { beforeAlias = claVarName; setAlias = aliasAs; - if(importFailedCallback == null || !importFailedCallback(oldSplitName, toSetName)){ + if(importFailedCallback == null || !importFailedCallback(oldSplitName, toSetName, isWildCard)){ beforeAlias = null; setAlias = null; error(EInvalidClass(oldClassName)); From 45970ce091750f6592bfc4b1218c326fc57a8586 Mon Sep 17 00:00:00 2001 From: hackx2 <80620538+hackx2@users.noreply.github.com> Date: Sun, 22 Nov 2026 12:06:15 +0000 Subject: [PATCH 2/2] call `importFailedCallback` before erroring on invalid package --- hscript/Interp.hx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hscript/Interp.hx b/hscript/Interp.hx index 894edc97..ca10f3cf 100644 --- a/hscript/Interp.hx +++ b/hscript/Interp.hx @@ -1026,8 +1026,10 @@ class Interp { final types = TypeListRegistry.get(pkg); if(types == null) { - // copying the invalid class error - error(ECustom('Invalid package: $pkg was not found')); + if (importFailedCallback == null || !importFailedCallback(pkg.split("."), null, true)) { + // copying the invalid class error + error(ECustom('Invalid package: $pkg was not found')); + } return; }