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
400
CA 1Day Youth Bootcamp for Frontend LT
brn
0
790
Modern TypeScript
brn
2
750
javascript - behind the scene
brn
3
680
tc39 proposals
brn
0
780
プロダクト開発とTypeScript
brn
8
2.8k
React-Springでリッチなアニメーション
brn
1
600
Other Decks in Programming
See All in Programming
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
230
Vapor Revolution
kazupon
1
170
カンファレンスの「アレ」Webでなんとかしませんか? / Conference “thing” Why don't you do something about it on the Web?
dero1to
1
110
CSC509 Lecture 13
javiergs
PRO
0
110
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
630
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
270
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.8k
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.2k
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.3k
Featured
See All Featured
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
A Modern Web Designer's Workflow
chriscoyier
693
190k
The Invisible Side of Design
smashingmag
298
50k
For a Future-Friendly Web
brad_frost
175
9.4k
Agile that works and the tools we love
rasmusluckow
327
21k
Into the Great Unknown - MozCon
thekraken
32
1.5k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
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