Commit 515ae400 authored by Deucе's avatar Deucе 👌🏾
Browse files

Add console.flush() method.

Seems to work a treat.
parent 9488bda6
Pipeline #3528 passed with stage
in 5 minutes and 23 seconds
......@@ -2308,6 +2308,24 @@ js_progress(JSContext *cx, uintN argc, jsval *arglist)
return JS_TRUE;
static JSBool
js_flush(JSContext *cx, uintN argc, jsval *arglist)
sbbs_t* sbbs;
jsrefcount rc;
if((sbbs=(sbbs_t*)js_GetClassPrivate(cx, JS_THIS_OBJECT(cx, arglist), &js_console_class))==NULL)
return JS_FALSE;
JS_SET_RVAL(cx, arglist, JSVAL_VOID);
return JS_TRUE;
static jsSyncMethodSpec js_console_functions[] = {
{"inkey", js_inkey, 0, JSTYPE_STRING, JSDOCSTR("[mode=<tt>K_NONE</tt>] [,timeout=<tt>0</tt>]")
,JSDOCSTR("get a single key with optional <i>timeout</i> in milliseconds (defaults to 0, for no wait).<br>"
......@@ -2581,6 +2599,10 @@ static jsSyncMethodSpec js_console_functions[] = {
,JSDOCSTR("removes a callback installed by once")
{"flush", js_flush, 2, JSTYPE_VOID, JSDOCSTR("type, id")
,JSDOCSTR("flushes the output buffer")
Supports Markdown
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