• I get the same thing here - I'm afraid there's some kind of problem with the compiled code's handling of function parameters. I haven't been able to figure it out yet I'm afraid.

    For instance:

    function t(a,b,c) { 
      "compiled";
      return a+","+b+","+c;
    }
    
    >t(1,2,3)
    ="1,1,3"
    >t("a","b","c")
    ="a,a,c"
    

    However the C++ function that's being created from it appears to be fine:

    extern "C" {
     JsVar *myFunction(JsVar *a, JsVar *b, JsVar *c) {
      return SV(jsvMathsOp(SV(jsvMathsOp(SV(jsvMathsOp(SV(jsvMathsOp(SV::notOwned(a), SV(jsvNewFromString(",")), '+')), SV::notOwned(b), '+')), SV(jsvNewFromString(",")), '+')), SV::notOwned(c), '+')).give();
      return 0; // just in case
     }
    }
    

    (SV is a 'smart pointer' class). I can only assume it's something to do with the way GCC is actually compiling the code :(

About

Avatar for Gordon @Gordon started