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
mocha - ESNext Transpliler の紹介
Search
Taketoshi Aono(青野健利 a.k.a brn)
December 14, 2017
Programming
1
270
mocha - ESNext Transpliler の紹介
古のEcmascript Harmony時代のTransplilerを自作していたので供養します。
Taketoshi Aono(青野健利 a.k.a brn)
December 14, 2017
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
8.9k
JSON & Object Tips
brn
1
380
CA 1Day Youth Bootcamp for Frontend LT
brn
0
780
Modern TypeScript
brn
2
740
javascript - behind the scene
brn
3
680
tc39 proposals
brn
0
770
プロダクト開発とTypeScript
brn
8
2.8k
React-Springでリッチなアニメーション
brn
1
590
Other Decks in Programming
See All in Programming
リリース8年目のサービスの1800個のERBファイルをViewComponentに移行した方法とその結果
katty0324
2
3k
現場で役立つモデリング 超入門
masuda220
PRO
12
2.7k
offers_20241022_imakiire.pdf
imakurusu
2
330
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
0
130
色々なIaCツールを実際に触って比較してみる
iriikeita
0
190
プロジェクト新規参入者のリードタイム短縮の観点から見る、品質の高いコードとアーキテクチャを保つメリット
d_endo
1
970
Vaporモードを大規模サービスに最速導入して学びを共有する
kazukishimamoto
4
4.3k
go.mod、DockerfileやCI設定に分散しがちなGoのバージョンをまとめて管理する / Go Connect #3
arthur1
10
2.3k
役立つログに取り組もう
irof
24
8k
PLoP 2024: The evolution of the microservice architecture pattern language
cer
PRO
0
1.2k
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
1
170
讓數據說話:用 Python、Prometheus 和 Grafana 講故事
eddie
0
330
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
334
57k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
46
2.1k
Embracing the Ebb and Flow
colly
84
4.4k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.2k
Producing Creativity
orderedlist
PRO
341
39k
How to train your dragon (web standard)
notwaldorf
88
5.6k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Building an army of robots
kneath
302
42k
Documentation Writing (for coders)
carmenintech
65
4.4k
What's new in Ruby 2.0
geeforr
342
31k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Transcript
Mocha ES Harmony Traspiler
Name @brn (ꫬꅿ⨳ⵃ) Occupation ؿٗٝزؒٝسؒٝآص،٥ط؎ذ؍ـؒٝآص، Company Cyberagent ،سذؙأةآؔ AI Messenger
Blog http://abcdef.gets.b6n.ch/ Twitter https://twitter.com/brn227 GitHub https://github.com/brn
剑ⴱח闐זֽלזזְֿהָ֮תׅկ ״ֻ罋ִֿכ⳿ؔث単ךדכ 兛鸐ך単⢪גְׅתׇ
הְֲֽד㢳ⴓ耀ְג ⡦חזזְ涪邌דׅ ׃ַ⡲ך2011/04דׅ ְׅתׇ וֲ׃ג⣘균׃ַׄׯ…
Ecmascript 2017 Ecmascript 2016 Ecmascript 6/2015 E Ec cm ma
as sc cr ri ip pt t h ha ar rm mo on ny y Ecmascript 5 Ecmascript 3
Harmony鋙ִגתַׅ
Ecmascript 4갽䮲ך穗꿀ַծ ぐكٝت٦װⰕד倜ז鎉铂堣腉ך 瘻㹀ח《穈꧊ת
䔲儗ES wikiהְֲل٦آָ㶷㖈׃גֶծ ֿחproposalהstrawmanהְֲ✳珏겲ך 堣腉فٗه٦ؠٕل٦آָ֮
鋅䔲儗ך猘כ չزٓٝأػ؎ٓ⡲պ הזךד֮ Babelזגתזְ
せכ؝٦ؼ٦אזָד Mochaח寸㹀װ mochaכ猘ךקֲָ⯓חㄏせ׃דׅ ذأزخ٦ٕךmocha״⯓ח ת֮⚅ח⳿׃גזְַ䠐זְֽו
Mocha C++ד剅ְEcmascript3ַEcmascript harmonyפךزٓٝأػ ؎ٓ V8䵧鯹׃גְךדreplד㹋ꥷח㢌䳔׃זָ㹋遤〳腉
Debuggable SourceMapָ㶷㖈׃גְזְ儗➿ךד ♧遤♧遤ח遤侧הtry-catch䮠ֿהדرغحؚ〳腉ח
function fibonacci(num) {! var a = 1, b = 0,
temp;! ! while (num >= 0){! temp = a;! a = a + b;! b = temp;! num--;! }! ! return b;! }!
function fibonacci(num) {! try {! __LINE__ = 2;! var a
= 1,! b = 0,! temp;! ! __LINE__ = 4;! while (num >= 0){! ! __LINE__ = 5;! temp = a;! ! __LINE__ = 6;! a = a+b;! ! __LINE__ = 7;! b = temp;! ! __LINE__ = 8;! num -- ;! }! __LINE__ = 11;! return b;! } catch(__mocha_error){! __Runtime.exceptionHandler(__LINE__, __FILE__, __mocha_error);! }! }!
Runtime harmonyך葿ղז㢌䳔遤ֲחRuntime欽䠐 Runtimeכⴓⶴׁגֶ䗳銲ח䘔ׄגappendׁ ׁח؝ٝػ؎ٕ儗חASTתד㢌䳔ׁךדծ鷄⸇ךزٓٝأ ؿؓ٦ي؝أزכקרئٗ
Transofrm Harmonyך圓俑הStrawmanח֮劢䱰欽ך،؎ر؍،ך⚕倯 䱰欽
وصُ،ٕכֿֿח http://brn.github.io/mocha/ja/
Ideas 㛇劤涸חכ䩛דػ٦؟剅ְג AST穈甧גגծַֿAST㢌䕎׃גְֻ 剑䖓כתAST鴬גؿ؋؎ٕח剅ֹ⳿׃
Hard to solve ،ٗ٦ꟼ侧ָ⦜ זח׃ػة٦ָٝ㢳ְ
// thisを束縛しない関数宣言 foo(x, y, z) -> console.log(this);! // thisを束縛しない関数式 var
foo = (x, y, z) -> console.log(this);! // thisを束縛する関数宣言 var foo = (x, y, z) => console.log(this);! // thisを束縛する関数式 foo(x,y,z) => console.log(this);!
File watcher ؿ؋؎ٕ湊鋔堣腉㣐㢌 windowծlinuxծmacדAPIָ麩ֲ… 㧅⼿׃גlinuxכInotifyծ⟃㢩כٕ٦فח׃
V8 V8ך⢪ְ倯项俱ָ㼰זֻג㣐㢌 أٖحسָ窃ה閯ךAbort鸬涪ׅ׃… ا٦أ铣纷湡ח…
libuv ׃ַ閯חLibuvתד䵧鯹׃גְגNode.JSךؙٗ٦ְٝז朐䡾 ח…
תה ⡲ך㣐㢌ֽו䖤ךכ㢳ַ ֿד䧭➣דֹתׅ ֿֿח㟌ָ֮ https://github.com/brn/mocha