Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

some tweaks to compile with NME client

  • Loading branch information...
commit c89d66563d543d834511be2187881e39fb03bd11 1 parent 125939a
@cloudshift authored
View
4 cloudshift/Core.hx
@@ -183,12 +183,12 @@ class Core {
public static function
parse(str:String):Dynamic {
- return untyped __js__("JSON.parse(str)");
+ return haxe.Json.parse(str);
}
public static function
stringify(obj:Dynamic):String {
- return untyped __js__("JSON.stringify(obj)");
+ return haxe.Json.stringify(obj);
}
public static
View
20 cloudshift/Mixin.hx
@@ -33,7 +33,11 @@ class DynamicX {
public static function
stringify(o:Dynamic):String {
+ #if js
return untyped __js__("JSON.stringify(o)");
+ #else
+ return Std.string(o);
+ #end
}
}
@@ -186,12 +190,20 @@ class StringX {
public static function
parse(str:String):Dynamic {
+ #if js
return untyped __js__("JSON.parse(str)");
+ #else
+ return haxe.Json.parse(str);
+ #end
}
public static inline function
clone(o:Dynamic):Dynamic {
+ #if js
return untyped __js__("JSON.parse(JSON.stringify(o))");
+ #else
+ return haxe.Json.parse(haxe.Json.stringify(o));
+ #end
}
inline static public function
@@ -225,7 +237,11 @@ class DateX {
}
public static function UTCString(d:Date) : String {
+ #if js
return untyped __js__("d.toUTCString()");
+ #else
+ return Std.string(d);
+ #end
}
}
@@ -233,7 +249,11 @@ class ArrayX {
public static function
stringify<T>(a:Array<T>):String {
+ #if js
return untyped __js__("JSON.stringify(o)");
+ #else
+ return Std.string(a);
+ #end
}
View
3  cloudshift/Sys.hx
@@ -32,7 +32,8 @@ enum SysWriteStreamEvents {
enum SysReadStreamEvents {
Data(d:String);
Error(e:String);
- End;
+
+ End;
Close;
Fd;
}
View
7 cloudshift/core/LogImpl.hx
@@ -47,8 +47,11 @@ class LogImpl {
var b = new NodeBuffer(msg+"\n",NodeC.UTF8);
Node.fs.write(logFileFD,b,0,b.length,null);
}
- else
+ else {
+ #if js
untyped __js__("console.log(msg)");
+ #end
+ }
}
}
@@ -56,6 +59,7 @@ class LogImpl {
static function
write(msg,type) {
+ #if js
if (msg != null)
switch(type) {
case "info":
@@ -69,6 +73,7 @@ class LogImpl {
default:
untyped __js__("console.log(msg)");
}
+ #end
}
#end
View
3  cloudshift/http/RemoteImpl.hx
@@ -12,7 +12,8 @@ class RemoteImpl extends Context, implements RemoteProvider {
public function
httpHandler(re:EReg,req:NodeHttpServerReq,resp:NodeHttpServerResp) {
if(Reflect.field(req.headers,"x-haxe-remoting") == null){
- resp.end("bad request");
+ resp.end("bad remoting request");
+ return;
}
HttpImpl.parseFields(req,function(flds,optFiles) {
Please sign in to comment.
Something went wrong with that request. Please try again.