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
9k
JSON & Object Tips
brn
1
410
CA 1Day Youth Bootcamp for Frontend LT
brn
0
820
Modern TypeScript
brn
2
750
javascript - behind the scene
brn
3
690
tc39 proposals
brn
0
800
プロダクト開発とTypeScript
brn
8
2.8k
React-Springでリッチなアニメーション
brn
1
620
Other Decks in Programming
See All in Programming
rails statsで大解剖 🔍 “B/43流” のRailsの育て方を歴史とともに振り返ります
shoheimitani
2
930
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
540
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
310
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
740
tidymodelsによるtidyな生存時間解析 / Japan.R2024
dropout009
1
770
たのしいparse.y
ydah
3
120
Zoneless Testing
rainerhahnekamp
0
120
103 Early Hints
sugi_0000
1
230
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
4
1.1k
nekko cloudにおけるProxmox VE利用事例
irumaru
3
430
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
130
モバイルアプリにおける自動テストの導入戦略
ostk0069
0
110
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
520
39k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Code Review Best Practice
trishagee
65
17k
The Language of Interfaces
destraynor
154
24k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
A Philosophy of Restraint
colly
203
16k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Unsuck your backbone
ammeep
669
57k
The Cult of Friendly URLs
andyhume
78
6.1k
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