Pro Yearly is on sale from $80 to $50! »

tc39 proposals

tc39 proposals

tc39のproposals
throw expression
richer-keys
class-access-expression

Transcript

  1. tc39_study (throw_expressions) (Richer_Keys) (Class_Access_Expressions)

  2. Name !CSO 5BLFUPTIJ"POP੨໺݈ར  Occupation 'SPOUFOE%FWFMPQFS1SPEVDU0XOFS Company $ZCFSBHFOU"EUFDI4UVEJP"*.FTTFOHFS OSS $POUSJCVUPSPG7

    About IUUQJOGPCODI
  3. 5ISPXFYQSFTTJPO

  4. 8IBUJTUISPXFYQSFTTJPO 5ISPXΛFYQSFTTJPO͔͠ॻ͚ͳ͍৔ॴͰ΋ॻ͚ΔΑ͏ʹͨ͠

  5. function save(filename = throw new TypeError("Argument required")) { }

  6. function getEncoder(encoding) { const encoder = encoding === "utf8" ?

    new UTF8Encoder() : encoding === "utf16le" ? new UTF16Encoder(f alse) : encoding === "utf16be" ? new UTF16Encoder(t rue) : throw new Error("Unsupported encoding"); }
  7. *NQMFNFOUBUJPO ࣮͸ੲ7ʹ࣮૷͠·ͨ͠ɻ݁ہ$-͸"CBOEPO͠·͕ͨ͠ɻ

  8. 1SPCMFN ࣮͸લఏͱͯ͠ 1SPQPTBMUP&YQMPSF&$."4DSJQU4UBUFNFOUTBT&YQSFTTJPOT IUUQTHJUIVCDPNSCVDLUPOQSPQPTBMTUBUFNFOUTBT FYQSFTTJPOTSFBENF ͱ͍͏ఏҊ͕TUBHFʹ͋ͬͨɻ TUBUFNFOUΛFYQSFTTJPOͱͯ͠औѻ͏͜ͱ͕Ͱ͖ΔΑ͏ʹ͢Δͱ͍͏ఏҊ

  9. 1SPCMFN ͨͩ͠ɺ&DNBTDSJQUʹ͓͚ΔTUBUFNFOUͱFYQSFTTJPOͷࠞಉ͕ ݴޠΛΑΓෳࡶʹͯ͠͠·͏ͷͰਐల͸ͳ͘ UISPXFYQSFTTJPOʹؔͯ͠΋จ๏ͷ௥Ճʹରͯ͠ωΨςΟϒͳ݁࿦͕ग़ͯ ͍ͯTUBHFʹਐΉ͜ͱ͸ͳͦ͞͏

  10. %PFYQSFTTJPO ͦͯ͠ߋʹEPFYQSFTTJPOͱ͍͏QSPQPTBM͕ࠓճఏҊ͞Ε͍ͯΔશͯͷ TUBUFNFOUͱFYQSFTTJPO໰୊Λղܾͯ͠͠·͏ͷͰ ଟ෼TUBHF͕ਐΉ͜ͱ͸ͳ͍͔΋͠Εͳ͍ɻ

  11. function save(filename = do { throw new TypeError("Argument required”) })

    { } // σϑΥϧτύϥϝʔλͰͷdoࣜ͸·ͩະఆ
  12. function getEncoder(encoding) { const encoder = encoding === "utf8" ?

    new UTF8Encoder() : encoding === "utf16le" ? new UTF16Encoder(f alse) : encoding === "utf16be" ? new UTF16Encoder(t rue) : do { throw new Error("Unsupported encoding”); } }
  13. 1SPQPTBMSJDIFSLFZT

  14. $PNQPTFEQSPQPTBM $PMMFDUJPO\UP,FZ UP7BMVF^ͱDPNQPTJUF,FZ DPNQPTJUF4ZNCPM ͷ̎ͭͷQSPQPTBMͷ૊Έ߹Θͤ ͲͪΒ΋ΦϒδΣΫτͷࣝผʹ͍ͭͯ

  15. $PMMFDUJPO\UP,FZ UP7BMVF^ $PMMFDUJPOʹUP,FZͱUP7BMVFΛ௥Ճ͢Δ

  16. new Map([], { toKey(key) {return normalizedKey;}, toValue(value) {return normalizedValue;}, });

    new WeakMap([], { toKey(key) {return normalizedKey;}, toValue(value) {return normalizedValue;}, }); new Set([], { toValue(value) {return normalizedValue;}, }); new WeakSet([], { toValue(value) {return normalizedValue;}, });
  17. DPNQPTJUF,FZ DPNQPTJUF4ZNCPM ෳ਺ͷΦϒδΣΫτ͔ΒΩʔΛੜ੒͢Δ DPNQPTJUF,FZͱDPNQPTJUF4ZNCPM"1*Λ௥Ճ͢Δ Ҿ਺ͷॱং͕ҧ͚Ε͹ҧ͏ΩʔͱͳΔ Ωʔʹར༻͞ΕͨΦϒδΣΫτ͸8FBL.BQͰ؅ཧ͞ΕΔͷͰΦϒδΣΫτ ͕ফ͑Ε͹ϝϞϦ͔Β΋ফ͑Δ

  18. compositeKey(...parts: [...any]) : Object.freeze({__proto__:null}) compositeSymbol(...parts: [...any]) : Symbol()

  19. const myValues = new Map(); const components = [a, b];

    const myKey = compositeKey(...components); myValues.set(myKey, components); // ... let [a, b] = myValues.get(myKey);
  20. 4UBUVT UP,FZ͚ͩTUBHFʹͳΓ·ͨ͠ɻ UP7BMVF͕ඞཁ͔Ͳ͏͔͕TUBHFͰͷٞ࿦ʹͳΓͦ͏

  21. $MBTTBDDFTTFYQSFTTJPO

  22. 8IBUJTUIJT ΫϥεΦϒδΣΫτ΁ΞΫηε͢ΔҰ؏ͨ͠ํ๏Λఆٛ͢Δ

  23. class C { static f() { ... } g() {

    class.f(); } }
  24. 1SPCMFNTTPGBS TUBUJDͳΫϥεؔ਺ͷதͰUIJTΛ࢖ͬͨ৔߹ɺؔ਺ͷݺͼग़͞ΕํʹΑͬͯ UIJT͕มΘΔ Ϋϥε໊Λ࢖ͬͯ'PPCBSͱͨ͠৔߹ɺ'PPΛԿ౓΋ॻ͘ͷ͸%3:ʹ൓ͯ͠ ͍Δ UIJTDPOTUSVDUPS͔ΒࢀরͰ͖Δ͕ɺಉ͘͡UIJT͕TBGFͰ͸ͳ͍

  25. %JTDVTT ࢀরํ๏͕૿͑Δͷ͸޷·͘͠ͳ͍ 'PPCBSͷΑ͏ʹΫϥε໊ͰΞΫηε͢Δͷ͕γϯϓϧͰΑ͍ %3:Λߟ͑ΔͱUIJTDPOTUSVDUPS͕ͩɺ҆શͰ͸ͳ͍ DMBTTCBSͰ΋͍͍͔΋͠Εͳ͍

  26. 4UBUVT 4UBHFʹͳΓ·ͨ͠