Impact and overcome for latest JS standard
Alan Chiang, IT Wake
handle: @itsnotvalid
track for
The "browser language", JavaScript, has been around since 20-some years ago. Newer thoughts emerged to modernize the language, to make it faster, easier to maintain and add new features to it.
ES6, which stands for ECMAScript 6, is the proposal (now accepted) to provide new, perhaps backwards incompatible changes to the language to make it better for use in the future.
A steering committee, TC 39, was formed to make the decisions on which proposals are accepted. The proposal keeps updated until a point where it becomes stable. On Jun 17, 2015, the draft becomes current standard.
iojs --v8-options | grep "harmony"
--es_staging (enable all completed harmony features)
--harmony (enable all completed harmony features)
--harmony_shipping (enable all shipped harmony fetaures)
--harmony_modules (enable "harmony modules (implies block scoping)" (in progress))
--harmony_arrays (enable "harmony array methods" (in progress))
--harmony_array_includes (enable "harmony Array.prototype.includes" (in progress))
--harmony_regexps (enable "harmony regular expression extensions" (in progress))
--harmony_arrow_functions (enable "harmony arrow functions" (in progress))
--harmony_proxies (enable "harmony proxies" (in progress))
--harmony_sloppy (enable "harmony features in sloppy mode" (in progress))
--harmony_unicode (enable "harmony unicode escapes" (in progress))
--harmony_unicode_regexps (enable "harmony unicode regexps" (in progress))
--harmony_computed_property_names (enable "harmony computed property names" (in progress))
--harmony_rest_parameters (enable "harmony rest parameters" (in progress))
--harmony_tostring (enable "harmony toString")
--harmony_numeric_literals (enable "harmony numeric literals")
--harmony_strings (enable "harmony string methods")
--harmony_scoping (enable "harmony block scoping")
--harmony_templates (enable "harmony template literals")
--harmony_classes (enable "harmony classes (implies block scoping & object literal extension)")
--harmony_object_literals (enable "harmony object literal extensions")
{
let privateKey = Math.random();
var login = function (password) {
return password === privateKey;
};
}
"use strict";
{
var login;
(function () {
var privateKey = Math.random();
login = function login(password) {
return password === privateKey;
};
})();
}
square = (x) -> x * x
sum = (x, y) -> x + y
odd = (x) -> x % 2 isnt 0
even = (x) -> x % 2 is 0
run_loop = ->
fire_events((e) -> e.stopPropagation())
listen()
wait()
let square = (x) => x * x
let sum = (x, y) => x + y
let odd = (x) => x % 2 !== 0
let even = (x) => x % 2 === 0
let run_loop = () => {
fire_events((e) => e.stopPropagation())
listen()
return wait()
}