tryhaxe.org's SWF haxe.Json.stringify()?

96 views
Skip to first unread message

Raoul Duke

unread,
Jan 18, 2013, 7:55:23 PM1/18/13
to haxe...@googlegroups.com
class Test {
static function main(){
var x:Hash<String> = new Hash<String>();
x.set( "1", "one" );
trace( haxe.Json.stringify(x) );
}
}


gives
{"h" : "Dictionary"}

i woulda hoped for
{"1" : "one"}

?!?!? is this an SWF thing !?!?
thanks.

Raoul Duke

unread,
Jan 18, 2013, 7:57:14 PM1/18/13
to haxe...@googlegroups.com
the js output is

{"h":{"$1":"one"}}

which is also weird to me.

Jason O'Neil

unread,
Jan 18, 2013, 8:41:43 PM1/18/13
to haxe...@googlegroups.com

Try compiling with -D haxeJSON

That will be consistent cross platform, and maybe a little prettier. Might be a good default for tryhaxe.org

Raoul Duke

unread,
Jan 18, 2013, 8:56:44 PM1/18/13
to haxe...@googlegroups.com
On Fri, Jan 18, 2013 at 5:41 PM, Jason O'Neil <jason...@gmail.com> wrote:
> Try compiling with -D haxeJSON

oh, right. thanks!

i'd heard of that but had it all backwards, i thought that was the
default. oops.
Reply all
Reply to author
Forward
0 new messages