SpookyFM / hscript

Automatically exported from code.google.com/p/hscript
0 stars 0 forks source link

constructing non global class (new) #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I think in Interp.hx

function cnew( cl : String, args : Array<Dynamic> ) : Dynamic {
        return Type.createInstance(Type.resolveClass(cl),args);
    }

Should be:

function cnew( cl : String, args : Array<Dynamic> ) : Dynamic {
        return Type.createInstance(variables.get(cl),args);
    }

Otherwise constructing non-global classes fails.

Original issue reported on code.google.com by tecteun on 13 Jul 2011 at 9:58

GoogleCodeExporter commented 9 years ago
This is the default behavior : classes should be defined in haXe code, not in 
hScript. You can add your custom behavior by subclassing Interp and overriding 
the "cnew" method.

Original comment by ncanna...@gmail.com on 1 Aug 2011 at 1:57