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
Security_for_introducing_eBPF
kentatada
0
110
命名をリントする
chiroruxx
1
430
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
3
340
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
4
330
テスト自動化失敗から再挑戦しチームにオーナーシップを委譲した話/STAC2024 macho
ma_cho29
1
1.3k
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
150
PSR-15 はあなたのための ものではない? - phpcon2024
myamagishi
0
170
Jakarta EE meets AI
ivargrimstad
0
270
これが俺の”自分戦略” プロセスを楽しんでいこう! - Developers CAREER Boost 2024
niftycorp
PRO
0
190
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
5
850
103 Early Hints
sugi_0000
1
250
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
40
2.4k
We Have a Design System, Now What?
morganepeng
51
7.3k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
RailsConf 2023
tenderlove
29
940
Optimizing for Happiness
mojombo
376
70k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
810
Building Your Own Lightsaber
phodgson
103
6.1k
Why Our Code Smells
bkeepers
PRO
335
57k
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