Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions hscript/Interp.hx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class Interp {
/**
* Custom Import resolver. It's called when an import couldn't be resolved.
*/
public var importFailedCallback:Array<String>->Null<String>->Bool;
public var importFailedCallback:Array<String>->Null<String>->?Bool->Bool;

public var customClasses:Map<String, CustomClassHandler>;
public var variables:Map<String, Dynamic>;
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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;
}

Expand Down