Slide 1

Slide 1 text

ECMAScript 2016/11/20 ALT

Slide 2

Slide 2 text

ࣗݾ঺հ about_hiroppy abouthiroppy  TEAMS

Slide 3

Slide 3 text

JavaScriptͷඪ४ ECMAScript Ecma International - ECMA-262 - ECMA-402 specifications  ecma-international.org /publications/standards/Standard

Slide 4

Slide 4 text

Editions(only ECMA-262)  • 1996/06 - ECMA-262 (ES 1) • 1998/08 - ECMA-262 (ES 2) • 1999/12 - ECMA-262 (ES 3) • 2009/12 - ECMA-262 (ES 5) • 2011/06 - ECMA-262 (ES 5.1) • 2015/06 - ECMA-262 2015 (ES 6) • 2016/06 - ECMA-262 2016 (ES 7) • 2017/?? - ECMAScript 2017 (8th Edition) developer.mozilla.org/ja/docs/Web/JavaScript/Language_Resources

Slide 5

Slide 5 text

Editions(only ECMA-262)  • 1996/06 - ECMA-262 (ES 1) • 1998/08 - ECMA-262 (ES 2) • 1999/12 - ECMA-262 (ES 3) • 2009/12 - ECMA-262 (ES 5) • 2011/06 - ECMA-262 (ES 5.1) • 2015/06 - ECMA-262 2015 (ES 6) • 2016/06 - ECMA-262 2016 (ES 7) • 2017/?? - ECMAScript 2017 (8th Edition) ࠓίί ES2015͔Βຖ೥ϦϦʔε
 ͞ΕΔΑ͏ʹܾఆ͞Εͨ ࡦఆத

Slide 6

Slide 6 text

ECMA TC39  ECMAScriptͷඪ४ԽΛ
 ߦ͏ҕһձ ओཁͳϒϥ΢βϕϯμʔ
 ͷ୅දͳͲ͕ࢀՃ͠
 ٞ࿦͍ͯ͠Δ

Slide 7

Slide 7 text

TC39 Process  stage-0 stage-1 stage-2 stage-3 stage-4 Strawman Proposal Draft Candidate Finished tc39.github.io/process-document

Slide 8

Slide 8 text

TC39 Process  stage-1 stage-2 stage-3 stage-4 tc39.github.io/process-document stage-0 Strawman ΞΠσΞ tc39/proposalsͷstage-0΁
 PRΛग़͢ɻ TC39 championΛऔಘ͠ tc39/proposals/blob/master/CONTRIBUTING.md#proposals

Slide 9

Slide 9 text

TC39 Process  stage-0 stage-2 stage-3 stage-4 tc39.github.io/process-document Proposal stage-1 ௥Ճ͢ΔͨΊͷέʔε࡞੒
 (polyfills / demos) જࡏత՝୊ͷಛఆ

Slide 10

Slide 10 text

TC39 Process  stage-0 stage-1 stage-3 stage-4 tc39.github.io/process-document Draft stage-2 ECMAScriptඪ४Λ࢖༻͠
 ߏจͱηϚϯςΟοΫͷ
 ਖ਼֬ͳઆ໌Λ͢Δɻ

Slide 11

Slide 11 text

TC39 Process  stage-0 stage-1 stage-2 stage-4 tc39.github.io/process-document stage-3 Candidate ࣮૷΍Ϣʔβ͔Βͷ
 ϑΟʔυόοΫΛٻΊΔɻ ͢΂ͯͷηϚϯςΟοΫɺ
 ߏจɺٴͼAPI͕ܾఆ͞ΕΔɻ

Slide 12

Slide 12 text

TC39 Process  stage-0 stage-1 stage-2 stage-3 tc39.github.io/process-document stage-4 Finished ਖ਼ࣜͳECMAScriptඪ४ʹ
 ؚΊΔ४උ͕Ͱ͖͍ͯΔ͜ͱ
 Λࣔ͢ɻ test262Ͱ࢖༻γφϦΦςετ͕
 ड୚ɺϚʔδ͞ΕΔඞཁ͕͋Δɻ 2ͭҎ্ͷޓ׵࣮૷͕ඞཁɻ

Slide 13

Slide 13 text

 stage-4ͷProposal͸ਖ਼ࣜʹ
 ࣍ظECMAScriptͷ࢓༷ͱͳΔ

Slide 14

Slide 14 text

Editions(only ECMA-262)  • 1996/06 - ECMA-262 (ES 1) • 1998/08 - ECMA-262 (ES 2) • 1999/12 - ECMA-262 (ES 3) • 2009/12 - ECMA-262 (ES 5) • 2011/06 - ECMA-262 (ES 5.1) • 2015/06 - ECMA-262 2015 (ES 6) • 2016/06 - ECMA-262 2016 (ES 7) • 2017/?? - ECMAScript 2017 (8th Edition)

Slide 15

Slide 15 text

ES2016 • Array.prototype.includes • Exponentiation Operator  const arr = [1, 2, 3]; if (arr.includes(2)) { console.log('aru!'); } if (2**3 === 8) { console.log('**'); }

Slide 16

Slide 16 text

ES2017 • String.prototype.padStart
 String.prototype.padEnd • Object.values
 Object.entries • Object.getOwnPropertyDescriptors • Trailing Commas in Function Param Lists • Async Functions 

Slide 17

Slide 17 text

string padding  'a'.padStart(5); // " a" 'a'.padEnd(5); // "a " 'a'.padStart(3, 'b'); // "bba" 'a'.padEnd(3, 'b'); // "abb" จࣈຒΊΛߦ͏ let num = 1; // `0${num}`.slice(-2); // 01 // ☺ num.toString().padStart(2, 0); // 01 tc39/proposal-string-pad-start-end

Slide 18

Slide 18 text

Object.values/Object.entries  const obj = { name: 'hello', age: 24 }; Object.values(obj); // Array [ "hello", 24 ] Object.entries(ob); // Array [ [ "name", "hello" ], [ "age", 24 ] ] tc39/proposal-object-values-entries

Slide 19

Slide 19 text

Object.
 getOwnPropertyDescriptors  ࢦఆͨ͠ΦϒδΣΫτͷ
 ͢΂ͯͷPropertyDescriptors
 Λऔಘ͢Δ attributes - value - writable - get - set - configurable - enumerable const obj = { name: 'hello', age: 24 }; Object.getOwnPropertyDescriptors(obj); // Object { name: Object, age: Object } /* Object { name: { configurable: true, enumerable: true, value: "hello", writable: true }, age: ... } */ tc39/proposal-object-getownpropertydescriptors

Slide 20

Slide 20 text

Trailing Commas 
 in Function Param Lists  ΧϯϚΛڐ༰͢Δ͜ͱʹΑΓ
 มߋ࣌ʹ࠷ޙඌͷϓϩύςΟ
 ͷΞοϓσʔτ
 (ΧϯϚΛ෇͚Ճ͑Δ)Λ๷͙ function post( p1, p2, ) {} post( 'hoge', 'fuga', ); tc39/proposal-trailing-function-commas

Slide 21

Slide 21 text

Async Functions  tc39/proposal-async-iteration import 'babel-polyfill'; (async () => { const str = await update(); console.info(str); })().catch((err) => console.error(err)); function update() { return new Promise((resolve, reject) => { setTimeout(() => resolve('finished!!'), 100); }); } ඇಉظͳॲཧΛಉظత
 ʹهड़͢Δ͜ͱ͕Մೳ

Slide 22

Slide 22 text

 JavaScript͸͜Ε͔Β΋
 ͲΜͲΜਐԽ͍͖ͯ͠·͢ʂ

Slide 23

Slide 23 text

Links • tc39/ecma262 • tc39/proposals • tc39/agendas • tc39/tc39-notes • kangax.github.io/compat-table/es6/