Skip to content

Commit

Permalink
fix -DhscriptPos support in ConsoleUtil.hx (HaxeFlixel#1840)
Browse files Browse the repository at this point in the history
With hscript version >= 2.0.5 compiling with -DhscriptPos gives compilation error:
flixel/4,0,1/flixel/system/debug/console/ConsoleUtil.hx:156: characters 9-42 : Class<hscript.Error> has no field EInvalidAccess

The proposed fix uses the error() method now defined in hscript's Interp class (following usage in hscript's Interp.hx)
  • Loading branch information
x2f authored and Aurel300 committed Apr 17, 2018
1 parent 4d2d6c0 commit 9ec79fd
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions flixel/system/debug/console/ConsoleUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,15 @@ private class Interp extends hscript.Interp

override function get(o:Dynamic, f:String):Dynamic
{
if (o == null)
throw hscript.Expr.Error.EInvalidAccess(f);
if (o == null) error(EInvalidAccess(f));
return Reflect.getProperty(o, f);
}

override function set(o:Dynamic, f:String, v:Dynamic):Dynamic
{
if (o == null)
throw hscript.Expr.Error.EInvalidAccess(f);
if (o == null) error(EInvalidAccess(f));
Reflect.setProperty(o, f, v);
return v;
}
}
#end
#end

0 comments on commit 9ec79fd

Please sign in to comment.