Upgrade to Pro — share decks privately, control downloads, hide ads and more …

WebKit ES6 Support

WebKit ES6 Support

Introduce the status of WebKit ES6 Support and WIP issues.

Yusuke SUZUKI

June 26, 2015
Tweet

More Decks by Yusuke SUZUKI

Other Decks in Programming

Transcript

  1. Self-introduction • WebKit Reviewer <[email protected]> – Expertise: CSS JIT, ECMAScript

    / JavaScript – IRC: yusukesuzuki • Owner of some ECMAScript modules – Escodegen, Escope, Esmangle, Estraverse, Doctrine etc. – Have you ever used it?
  2. Do you know the status of ES6 in WebKit? •

    The status of ES6 in WebKit JavaScriptCore – Not V8 / SpiderMonkey / Chakra • Already announced a lot of features will be shipped in Safari9
  3. The other parts (1) • iterators & for-of – Complete

    support of `iterator.return()` – Of course, @@iterator is supported • You can easily create the custom iterators • destructuring – Array, Object patterns are already supported – Rest element is just supported (WK) – Destructuring accepts iterators (WK) – Spec conformance becomes higher than Firefox 40
  4. The other parts (2) • Default initializer for assignments &

    decls – Like, `var { a = 20 } = obj;` • Several well-known Symbols – @@unscopable – @@iterator
  5. The other parts (3) • String extra methods – String#codePointAt,

    String#repeat etc. • Array extra methods – Array#find etc • Object extra methods – Object.assign, Object.getPrototypeOf etc. • Math extra methods – Math.imul etc. • Number extra methods
  6. The other parts (4) • Map, Set, WeakMap – Their

    implementation is upgraded to match to the ES6 spec – e.g. entries() returns iterator
  7. WebKit implementation status • WebKit now has a status page

    – http://www.webkit.org/status.html • Supported ES6 features are also listed here – When I implemented something, I will add it.
  8. Ongoing parts (1) • Arrow functions – Parsing functionality is

    just landed (today) • http://trac.webkit.org/changeset/185989 • Block scoped variables (let, const) – Patch by Saam • https://bugs.webkit.org/show_bug.cgi?id=142944
  9. Ongoing parts (2) • Default parameters – Since it requires

    blocked scope system (TDZ) • Spread operators
  10. Details of JSC • JSC already has the system to

    write builtin functions in JS – For example, Array#sort is rewritten in JS – Bucket & merge sort • Privileged JS code can emit bytecodes – @putDirectByVal • JS-written builtin encourages DFG/FTL JIT – ArrayIterator#next is written in JS • Inlining • Object sinking
  11. Conclusion • The latest WebKit will ship a lot of

    ES6 features • ES6 features are now actively implemented in WebKit