都怪自己眼瞎,辣么绿的一块都木看仔细
结果就是很悲催,网上找了一通,不行。连 babel-polyfill 都试了,回头再看一遍,Sogo, So easy!
var babel = require('gulp-babel')
gulp.src("./ES7/Exponentiation/demo.js")
.pipe(babel({presets: ["stage-1"]}))
.pipe(gulp.dest("./ES7/Exponentiation/dist"));
但是但是,好不容易到了终点,居然有 bug: Issue #26 · babel/babylon
具体代码可见: https://github.com/Vanessa219/emulation/tree/master/ES7/Exponentiation
顺带贴一下 ECMAScript 每个阶段的说明
The TC39 categorises proposals into 4 stages:
- stage-0 - Strawman: just an idea, possible Babel plugin.
- stage-1 - Proposal: this is worth working on.
- stage-2 - Draft: initial spec.
- stage-3 - Candidate: complete spec and initial browser implementations.
- stage-4 - Finished: will be added to the next yearly release.
Also check out the current tc39 proposals and its process document.
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于