static int Call(IntPtr cx, uint argc, IntPtr vp) { // if (useReflection) // return vCall.CallReflection(cx, argc, vp); // else return(vCall.CallCallback(cx, argc, vp)); }
static int CSEntry(int iOP, int slot, int index, int isStatic, int argc) { if (JSMgr.IsShutDown) { return(0); } try { vCall.CallCallback(iOP, slot, index, isStatic, argc); } catch (System.Exception ex) { /* * if exception occurs, catch it, pass the error to js, and return false * js then print the error string and js call stack * note: the error contains cs call stack, so now we have both cs and js call stack */ //JSApi.JSh_ReportError(cx, ex.ToString()); JSApi.reportError(ex.ToString()); return(0); } return(1); }