From 89b3c201047ff7c1bd77cb58046b83f48729bee9 Mon Sep 17 00:00:00 2001 From: Kevin Leung Date: Tue, 29 Dec 2015 10:55:04 +0800 Subject: [PATCH 1/2] Bandaid fix for nodejs Sys.stderr, stdout, stdin are not implemented (yet) in hxnodejs --- mcli/Dispatch.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcli/Dispatch.hx b/mcli/Dispatch.hx index 9f8d540..d495a60 100644 --- a/mcli/Dispatch.hx +++ b/mcli/Dispatch.hx @@ -310,7 +310,7 @@ using Lambda; private function errln(s:String) { -#if sys +#if (sys && !nodejs) Sys.stderr().writeString(s + "\n"); #else haxe.Log.trace(s,null); From 3485907bd86742d805bad63114072ec30522bdac Mon Sep 17 00:00:00 2001 From: Kevin Leung Date: Wed, 9 Mar 2016 11:05:14 +0800 Subject: [PATCH 2/2] Properly print to stderr on nodejs --- mcli/Dispatch.hx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mcli/Dispatch.hx b/mcli/Dispatch.hx index d495a60..d3a3b6f 100644 --- a/mcli/Dispatch.hx +++ b/mcli/Dispatch.hx @@ -310,7 +310,9 @@ using Lambda; private function errln(s:String) { -#if (sys && !nodejs) +#if nodejs + js.Node.process.stderr.write(s + "\n"); +#elseif sys Sys.stderr().writeString(s + "\n"); #else haxe.Log.trace(s,null); @@ -319,7 +321,7 @@ using Lambda; private function println(s:String) { -#if sys +#if (sys || nodejs) Sys.println(s); #else haxe.Log.trace(s,null);