vector[i++] = STRING_TO_JSVAL(str);
vector[j] = STRING_TO_JSVAL(str);
ProcessArgs(JSContext *cx, JSObject *obj, char **argv, int argc){    int i;    char *filename = NULL;    jsint length;    jsval *vector;    JSObject *argsObj;    JSBool isInteractive = JS_TRUE;    for (i=0; i < argc; i++) {	if (argv[i][0] == '-') {	    switch (argv[i][1]) {	    case 'v':		if (i+1 == argc) {		    return usage();		}		JS_SetVersion(cx, (JSVersion) atoi(argv[i+1]));		i++;		break;	    case 'w':		reportWarnings++;		break;	    case 's':		JS_ToggleOptions(cx, JSOPTION_STRICT);		break;            case 'c':                /* set stack chunk size */                gStackChunkSize = atoi (argv[++i]);                break;	    case 'f':		if (i+1 == argc) {		    return usage();		}		filename = argv[i+1];		/* "-f -" means read from stdin */		if (filename[0] == '-' && filename[1] == '\0')		    filename = NULL;		Process(cx, obj, filename);                filename = NULL;                /* XXX: js -f foo.js should interpret foo.js and then                 * drop into interactive mode, but that breaks test                 * harness. Just execute foo.js for now.                 */                isInteractive = JS_FALSE;		i++;		break;	    default:		return usage();	    }	} else {	    filename = argv[i++];            isInteractive = JS_FALSE;	    break;	}    }    length = argc - i;    if (length == 0) {        vector = NULL;    } else {        vector = (jsval *) JS_malloc(cx, length * sizeof(jsval));        if (vector == NULL)            return 1;        while (i < argc) {            JSString *str = JS_NewStringCopyZ(cx, argv[i]);            if (str == NULL)                return 1;            vector[i++] = STRING_TO_JSVAL(str);        }    }    argsObj = JS_NewArrayObject(cx, length, vector);    if (vector)        JS_free(cx, vector);    if (argsObj == NULL)	return 1;    if (!JS_DefineProperty(cx, obj, "arguments", OBJECT_TO_JSVAL(argsObj),                           NULL, NULL, 0)) {	return 1;    }    if (filename || isInteractive)        Process(cx, obj, filename);    return gExitCode;}