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
780
プロダクト開発とTypeScript
brn
8
2.8k
React-Springでリッチなアニメーション
brn
1
590
Other Decks in Programming
See All in Programming
Amazon Neptuneで始めてみるグラフDB-OpenSearchによるグラフの全文検索-
satoshi256kbyte
4
330
Outline View in SwiftUI
1024jp
1
120
Modern Angular: Renovation for Your Applications
manfredsteyer
PRO
0
210
推し活の ハイトラフィックに立ち向かう Railsとアーキテクチャ - Kaigi on Rails 2024
falcon8823
6
2.2k
ECSのサービス間通信 4つの方法を比較する 〜Canary,Blue/Greenも添えて〜
tkikuc
11
2.3k
Kotlin2でdataクラスの copyメソッドを禁止する/Data class copy function to have the same visibility as constructor
eichisanden
1
140
Boost Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
850
Realtime API 入門
riofujimon
0
110
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
340
PLoP 2024: The evolution of the microservice architecture pattern language
cer
PRO
0
1.6k
プロジェクト新規参入者のリードタイム短縮の観点から見る、品質の高いコードとアーキテクチャを保つメリット
d_endo
1
1k
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
3
400
Featured
See All Featured
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
KATA
mclloyd
29
13k
The Cult of Friendly URLs
andyhume
78
6k
Become a Pro
speakerdeck
PRO
24
5k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Happy Clients
brianwarren
97
6.7k
Why Our Code Smells
bkeepers
PRO
334
57k
Gamification - CAS2011
davidbonilla
80
5k
A Philosophy of Restraint
colly
203
16k
Git: the NoSQL Database
bkeepers
PRO
425
64k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
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