Commit 06bb516d authored by rswindell's avatar rswindell
Browse files

Don't try to convert args in cursor position routines if undefined.

parent 739db074
......@@ -904,7 +904,8 @@ js_ansi(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
if((sbbs=(sbbs_t*)JS_GetContextPrivate(cx))==NULL)
return(JS_FALSE);
JS_ValueToInt32(cx,argv[0],&attr);
if(argc)
JS_ValueToInt32(cx,argv[0],&attr);
if((js_str=JS_NewStringCopyZ(cx,sbbs->ansi(attr)))==NULL)
return(JS_FALSE);
......@@ -1010,7 +1011,8 @@ js_cursor_up(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
if((sbbs=(sbbs_t*)JS_GetContextPrivate(cx))==NULL)
return(JS_FALSE);
JS_ValueToInt32(cx,argv[0],&val);
if(argc)
JS_ValueToInt32(cx,argv[0],&val);
sbbs->cursor_up(val);
*rval=JSVAL_VOID;
return(JS_TRUE);
......@@ -1025,7 +1027,8 @@ js_cursor_down(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
if((sbbs=(sbbs_t*)JS_GetContextPrivate(cx))==NULL)
return(JS_FALSE);
JS_ValueToInt32(cx,argv[0],&val);
if(argc)
JS_ValueToInt32(cx,argv[0],&val);
sbbs->cursor_down(val);
*rval=JSVAL_VOID;
return(JS_TRUE);
......@@ -1040,7 +1043,8 @@ js_cursor_right(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
if((sbbs=(sbbs_t*)JS_GetContextPrivate(cx))==NULL)
return(JS_FALSE);
JS_ValueToInt32(cx,argv[0],&val);
if(argc)
JS_ValueToInt32(cx,argv[0],&val);
sbbs->cursor_right(val);
*rval=JSVAL_VOID;
return(JS_TRUE);
......@@ -1055,7 +1059,8 @@ js_cursor_left(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
if((sbbs=(sbbs_t*)JS_GetContextPrivate(cx))==NULL)
return(JS_FALSE);
JS_ValueToInt32(cx,argv[0],&val);
if(argc)
JS_ValueToInt32(cx,argv[0],&val);
sbbs->cursor_left(val);
*rval=JSVAL_VOID;
return(JS_TRUE);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment