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
800
Other Decks in Programming
See All in Programming
[Do iOS '24] Ship your app on a Friday...and enjoy your weekend!
polpielladev
0
110
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
610
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
630
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
250
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
2
1.1k
Nurturing OpenJDK distribution: Eclipse Temurin Success History and plan
ivargrimstad
0
950
Jakarta EE meets AI
ivargrimstad
0
590
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
Remix on Hono on Cloudflare Workers
yusukebe
1
300
flutterkaigi_2024.pdf
kyoheig3
0
150
Ethereum_.pdf
nekomatu
0
460
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
120
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
50
7.2k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
Code Review Best Practice
trishagee
64
17k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
The Cost Of JavaScript in 2023
addyosmani
45
6.8k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
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ʹͳΓ·ͨ͠