Skip to content
Snippets Groups Projects
Commit 2a6d61f3 authored by deuce's avatar deuce
Browse files

Add a console.writeln() function.

parent a9d346c7
No related branches found
No related tags found
No related merge requests found
......@@ -804,6 +804,14 @@ js_write(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
return(JS_TRUE);
}
static JSBool
js_writeln(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
if(!js_write(cx, obj, argc, argv, rval))
return(JS_FALSE);
return(js_crlf(cx, obj, argc, argv, rval))
}
static JSBool
js_putmsg(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
......@@ -1304,6 +1312,10 @@ static jsSyncMethodSpec js_console_functions[] = {
,JSDOCSTR("display a raw string")
,310
},
{"writeln", js_write, 1, JSTYPE_VOID, JSDOCSTR("text")
,JSDOCSTR("display a raw string followed by a carriage-return/line-feed pair (new-line)")
,315
},
{"putmsg", js_putmsg, 1, JSTYPE_VOID, JSDOCSTR("text [,mode=<tt>P_NONE</tt>]")
,JSDOCSTR("display message text (Ctrl-A codes, @-codes, pipe codes, etc), "
"see <tt>P_*</tt> in <tt>sbbsdefs.js</tt> for <i>mode</i> bits")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment