فهرست منبع

use new JsInterp for formulas

Nicolas Cannasse 11 ماه پیش
والد
کامیت
e62c671c3b
1فایلهای تغییر یافته به همراه5 افزوده شده و 3 حذف شده
  1. 5 3
      hide/comp/cdb/Formulas.hx

+ 5 - 3
hide/comp/cdb/Formulas.hx

@@ -186,10 +186,12 @@ class Formulas {
 
 		formulas = [];
 		fmap = new Map();
-		var interp = new hscript.Interp();
-		interp.variables.set("Math", Math);
+		var o : Dynamic = { Math : Math };
 		for( r in refs )
-			interp.variables.set(r.name, r);
+			Reflect.setField(o,r.name, r);
+		var interp = new hscript.JsInterp();
+		interp.ctx = o;
+		interp.properties = ["all" => true];
 
 		try interp.execute(expr) catch( e : hscript.Expr.Error ) {
 			ide.error(formulasFile+": "+e.toString());