Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 6 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions hscript/Checker.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 3 additions & 1 deletion hscript/Interp.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 2 additions & 0 deletions hscript/JsInterp.hx
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ class JsInterp extends Interp {
default:
error(EInvalidOp(op));
}
return null;
case EUnop(op, prefix, e):
switch( op ) {
case "!":
Expand Down Expand Up @@ -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) ) {
Expand Down
2 changes: 1 addition & 1 deletion hscript/LiveClass.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down