Haxe 3.3.0 (current build) | JavaScript target not fully closure compiler compatible anymore

67 views
Skip to first unread message

der Raab

unread,
Sep 28, 2016, 12:34:39 PM9/28/16
to Haxe
I did it. I Upgraded to the latest Haxe version (haxe-3.3.0-rc1-dev-3df5463.pkg) to create a local server using neko. So I started porting our existing projects to 3.3.0 as well.

But now I found out that the the new JavaScript output is not fully Google Closure Compiler compatible anymore. I use a lot of reflection to access properties within a JSON object loaded from somewhere. This works as expected - but the new JavaScript output does look completely different. So different actually, that I don't fully understand what is happening. It took me several hours to figure out a possible workaround. Which simply is to declare the key as a separate variable instead of using Reflect.getProperty( o, "key" ).

I just wanted to let you know if you experience something similar. And I already created an issue: https://github.com/HaxeFoundation/haxe/issues/5724




Juraj Kirchheim

unread,
Sep 28, 2016, 2:25:59 PM9/28/16
to haxe...@googlegroups.com

If reflection becomes a problem, consider using tink_json. As a bonus (according to Nadako) with Haxe 3.3 even the parsing is faster than native JSON.parse.


--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.

der Raab

unread,
Sep 28, 2016, 3:29:59 PM9/28/16
to Haxe
I had a quick look at https://github.com/haxetink/tink_json and I think this is not an option for us since we don't know exactly what to expect in the JSON data. And anyway - reflection has to work (and did in 3.2.1)  :)

der Raab

unread,
Sep 28, 2016, 3:36:55 PM9/28/16
to Haxe

Alexander Kuzmenko

unread,
Sep 28, 2016, 4:04:35 PM9/28/16
to Haxe
https://github.com/HaxeFoundation/haxe/blob/development/std/js/_std/Reflect.hx

среда, 28 сентября 2016 г., 22:36:55 UTC+3 пользователь der Raab написал:
Reply all
Reply to author
Forward
0 new messages