Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
tc39 proposals
Search
Taketoshi Aono(青野健利 a.k.a brn)
October 09, 2019
Programming
0
780
tc39 proposals
tc39のproposals
throw expression
richer-keys
class-access-expression
Taketoshi Aono(青野健利 a.k.a brn)
October 09, 2019
Tweet
Share
More Decks by Taketoshi Aono(青野健利 a.k.a brn)
See All by Taketoshi Aono(青野健利 a.k.a brn)
document.write再考
brn
6
2.9k
Parsing Javascript
brn
12
9k
JSON & Object Tips
brn
1
400
CA 1Day Youth Bootcamp for Frontend LT
brn
0
790
Modern TypeScript
brn
2
750
javascript - behind the scene
brn
3
680
プロダクト開発とTypeScript
brn
8
2.8k
React-Springでリッチなアニメーション
brn
1
600
javascript internationalization API
brn
0
790
Other Decks in Programming
See All in Programming
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
530
現場で役立つモデリング 超入門
masuda220
PRO
15
3.2k
役立つログに取り組もう
irof
28
9.6k
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
受け取る人から提供する人になるということ
little_rubyist
0
230
카카오페이는 어떻게 수천만 결제를 처리할까? 우아한 결제 분산락 노하우
kakao
PRO
0
110
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
330
WebフロントエンドにおけるGraphQL(あるいはバックエンドのAPI)との向き合い方 / #241106_plk_frontend
izumin5210
4
1.4k
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
Jakarta EE meets AI
ivargrimstad
0
510
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
How to Ace a Technical Interview
jacobian
276
23k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
We Have a Design System, Now What?
morganepeng
50
7.2k
Facilitating Awesome Meetings
lara
50
6.1k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Statistics for Hackers
jakevdp
796
220k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Embracing the Ebb and Flow
colly
84
4.5k
Transcript
tc39_study (throw_expressions) (Richer_Keys) (Class_Access_Expressions)
Name !CSO 5BLFUPTIJ"POP੨݈ར Occupation 'SPOUFOE%FWFMPQFS1SPEVDU0XOFS Company $ZCFSBHFOU"EUFDI4UVEJP"*.FTTFOHFS OSS $POUSJCVUPSPG7
About IUUQJOGPCODI
5ISPXFYQSFTTJPO
8IBUJTUISPXFYQSFTTJPO 5ISPXΛFYQSFTTJPO͔͠ॻ͚ͳ͍ॴͰॻ͚ΔΑ͏ʹͨ͠
function save(filename = throw new TypeError("Argument required")) { }
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"); }
*NQMFNFOUBUJPO ࣮ੲ7ʹ࣮͠·ͨ͠ɻ݁ہ$-"CBOEPO͠·͕ͨ͠ɻ
1SPCMFN ࣮લఏͱͯ͠ 1SPQPTBMUP&YQMPSF&$."4DSJQU4UBUFNFOUTBT&YQSFTTJPOT IUUQTHJUIVCDPNSCVDLUPOQSPQPTBMTUBUFNFOUTBT FYQSFTTJPOTSFBENF ͱ͍͏ఏҊ͕TUBHFʹ͋ͬͨɻ TUBUFNFOUΛFYQSFTTJPOͱͯ͠औѻ͏͜ͱ͕Ͱ͖ΔΑ͏ʹ͢Δͱ͍͏ఏҊ
1SPCMFN ͨͩ͠ɺ&DNBTDSJQUʹ͓͚ΔTUBUFNFOUͱFYQSFTTJPOͷࠞಉ͕ ݴޠΛΑΓෳࡶʹͯ͠͠·͏ͷͰਐలͳ͘ UISPXFYQSFTTJPOʹؔͯ͠จ๏ͷՃʹରͯ͠ωΨςΟϒͳ͕݁ग़ͯ ͍ͯTUBHFʹਐΉ͜ͱͳͦ͞͏
%PFYQSFTTJPO ͦͯ͠ߋʹEPFYQSFTTJPOͱ͍͏QSPQPTBM͕ࠓճఏҊ͞Ε͍ͯΔશͯͷ TUBUFNFOUͱFYQSFTTJPOΛղܾͯ͠͠·͏ͷͰ ଟTUBHF͕ਐΉ͜ͱͳ͍͔͠Εͳ͍ɻ
function save(filename = do { throw new TypeError("Argument required”) })
{ } // σϑΥϧτύϥϝʔλͰͷdoࣜ·ͩະఆ
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”); } }
1SPQPTBMSJDIFSLFZT
$PNQPTFEQSPQPTBM $PMMFDUJPO\UP,FZ UP7BMVF^ͱDPNQPTJUF,FZ DPNQPTJUF4ZNCPM ͷ̎ͭͷQSPQPTBMͷΈ߹Θͤ ͲͪΒΦϒδΣΫτͷࣝผʹ͍ͭͯ
$PMMFDUJPO\UP,FZ UP7BMVF^ $PMMFDUJPOʹUP,FZͱUP7BMVFΛՃ͢Δ
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;}, });
DPNQPTJUF,FZ DPNQPTJUF4ZNCPM ෳͷΦϒδΣΫτ͔ΒΩʔΛੜ͢Δ DPNQPTJUF,FZͱDPNQPTJUF4ZNCPM"1*ΛՃ͢Δ Ҿͷॱং͕ҧ͚Εҧ͏ΩʔͱͳΔ Ωʔʹར༻͞ΕͨΦϒδΣΫτ8FBL.BQͰཧ͞ΕΔͷͰΦϒδΣΫτ ͕ফ͑ΕϝϞϦ͔Βফ͑Δ
compositeKey(...parts: [...any]) : Object.freeze({__proto__:null}) compositeSymbol(...parts: [...any]) : Symbol()
const myValues = new Map(); const components = [a, b];
const myKey = compositeKey(...components); myValues.set(myKey, components); // ... let [a, b] = myValues.get(myKey);
4UBUVT UP,FZ͚ͩTUBHFʹͳΓ·ͨ͠ɻ UP7BMVF͕ඞཁ͔Ͳ͏͔͕TUBHFͰͷٞʹͳΓͦ͏
$MBTTBDDFTTFYQSFTTJPO
8IBUJTUIJT ΫϥεΦϒδΣΫτΞΫηε͢ΔҰ؏ͨ͠ํ๏Λఆٛ͢Δ
class C { static f() { ... } g() {
class.f(); } }
1SPCMFNTTPGBS TUBUJDͳΫϥεؔͷதͰUIJTΛͬͨ߹ɺؔͷݺͼग़͞ΕํʹΑͬͯ UIJT͕มΘΔ Ϋϥε໊Λͬͯ'PPCBSͱͨ͠߹ɺ'PPΛԿॻ͘ͷ%3:ʹͯ͠ ͍Δ UIJTDPOTUSVDUPS͔ΒࢀরͰ͖Δ͕ɺಉ͘͡UIJT͕TBGFͰͳ͍
%JTDVTT ࢀরํ๏͕૿͑Δͷ·͘͠ͳ͍ 'PPCBSͷΑ͏ʹΫϥε໊ͰΞΫηε͢Δͷ͕γϯϓϧͰΑ͍ %3:Λߟ͑ΔͱUIJTDPOTUSVDUPS͕ͩɺ҆શͰͳ͍ DMBTTCBSͰ͍͍͔͠Εͳ͍
4UBUVT 4UBHFʹͳΓ·ͨ͠