Node --harmony for atom extensions


#1

Is there a way to write an atom extension that uses node --harmony features such as generators?


#2

If you write your package using JS then yes.


#3

@abe, Won’t work in coffee? Also, coffee has tricks to fall back to native JS, haven’t used them, do you think those would work?


#4

Nope, CS motto has always been to only implement what’s available in every browsers, so it sticks to ES3 as old IEs are still widely spread and doesn’t even support ES5 fully. But you can always use backticks, I wouldn’t advice that though.


#5

You just need back-ticks around JS code to run it in CS. I don’t know I there is something funny about using them with generators. I can’t think of any reason why they wouldn’t work.


#6

Nothing prevents it to run, but backticks in CS are generally considered as a bad practice. Personally I tried to avoid it in everyday code, and if I really have to use JS directly I try to isolate the code in question and put it in its own JS file that I’ll require in my CS code.


#7

Putting JS in its own function is another form of isolation. In other words a wrapper.