diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 026aaad2..4b4265e3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,12 +9,16 @@ on: jobs: build: + strategy: + matrix: + haxe-version: [latest, 4.3.7, 4.2.5] + fail-fast: false runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: krdlab/setup-haxe@v1 + - uses: krdlab/setup-haxe@v2 with: - haxe-version: 4.3.4 + haxe-version: ${{ matrix.haxe-version }} - name: Install haxelib dependencies run: | haxelib install hx3compat diff --git a/hscript/Checker.hx b/hscript/Checker.hx index ab7c7abb..399a6708 100644 --- a/hscript/Checker.hx +++ b/hscript/Checker.hx @@ -1203,7 +1203,7 @@ class Checker { switch( e.e ) { case EField(obj, f): if( cf.isMethod ) { - switch( callExpr?.e ) { + switch( callExpr == null ? null : callExpr.e ) { case null: case ECall(ec,params) if( ec == e ): e.e = EField(acc,f); @@ -1534,7 +1534,7 @@ class Checker { function getTypeAccess( t : TType, expr : Expr, ?field : String ) : ExprDef { var path = switch( t ) { - case TInst(c,_): c.runtimePath ?? c.name; + case TInst(c,_): c.runtimePath != null ? c.runtimePath : c.name; case TEnum(e,_): e.name; default: return null; } diff --git a/hscript/Interp.hx b/hscript/Interp.hx index ce8cb58d..b2c959b0 100644 --- a/hscript/Interp.hx +++ b/hscript/Interp.hx @@ -56,11 +56,13 @@ class Interp { variables.set("$resolve", resolveType); } + #if js + static var ABS_CACHE = new Map(); + #end function resolveType( path : String ) : Dynamic { #if js // abstract type is not part of the class map if( path.charCodeAt(0) == '#'.code ) { - static var ABS_CACHE = new Map(); var c = ABS_CACHE.get(path); if( c != null ) return c; c = js.Lib.eval(path.substr(1)); diff --git a/hscript/JsInterp.hx b/hscript/JsInterp.hx index 9161c441..2f91a7d6 100644 --- a/hscript/JsInterp.hx +++ b/hscript/JsInterp.hx @@ -264,6 +264,7 @@ class JsInterp extends Interp { default: error(EInvalidOp(op)); } + return null; case EUnop(op, prefix, e): switch( op ) { case "!": @@ -300,6 +301,7 @@ class JsInterp extends Interp { default: error(EInvalidOp(op)); } + return null; case ECall(e, params): var args = [for( p in params ) exprValue(p)]; switch( Tools.expr(e) ) { diff --git a/hscript/LiveClass.hx b/hscript/LiveClass.hx index 11d04192..20b04397 100644 --- a/hscript/LiveClass.hx +++ b/hscript/LiveClass.hx @@ -25,7 +25,7 @@ class LiveClass { if( api == null ) CONFIG = null; else - CONFIG = { api : api, srcPath : srcPath ?? [".","src"] } + CONFIG = { api : api, srcPath : srcPath != null ? srcPath : [".","src"] } } static function hasRet( e : Expr ) : Bool {