ES5+

101 views
Skip to first unread message

Philippe Elsass

unread,
Nov 10, 2015, 6:23:41 AM11/10/15
to Haxe
Hello,

What is the status of ES5+ support?

Like I wonder what exactly does '-D js-es5' do.

And I believe it would be beneficial to use native ES5 Array methods, when we can afford to be IE9+ compatible, instead of Lambda implementations (eg. where is Array.reduce?).

--
Philippe

Dan Korostelev

unread,
Nov 10, 2015, 7:08:43 AM11/10/15
to Haxe
Right now, -D js-es5 removes some polyfills for Array (indexOf/lastIndexOf/map/filter) as well as fake console object for environments where it's not available (ie8).

As for Array.reduce and other methods present in JS, we can either implement them for every other platform (though flash doesn't have it natively) and add to our base Array class, or add something like js.NativeArray static extension class similar to cpp.NativeArray, so one could just do `using js.NativeArray` and have those extra methods available.

Feel free to open a discussion issue on the haxe repo.


вторник, 10 ноября 2015 г., 14:23:41 UTC+3 пользователь Philippe Elsass написал:

Juraj Kirchheim

unread,
Nov 10, 2015, 7:23:25 AM11/10/15
to haxe...@googlegroups.com
On Tue, Nov 10, 2015 at 1:08 PM, Dan Korostelev <nad...@gmail.com> wrote:
Right now, -D js-es5 removes some polyfills for Array (indexOf/lastIndexOf/map/filter) as well as fake console object for environments where it's not available (ie8).

Also, it gives JavaScript ninjas a compiler flag to switch on and instantaneously feel awesome! :D

Philippe Elsass

unread,
Nov 10, 2015, 7:29:28 AM11/10/15
to Haxe
Thanks, that would be nice describing that to the doc - I need to look into editing the manual now ;)

 Adding reduce to the Array class would be nice: https://github.com/HaxeFoundation/haxe/issues/4637


--
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.



--
Philippe

Marcelo de Moraes Serpa

unread,
Nov 10, 2015, 5:40:00 PM11/10/15
to haxe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages