Babel 7.2.0 发布,JavaScript 编译器

  

Babel 7.2.0 已发布,Babel 是用于编写下一代 JavaScript 的编译器。此版本包含对私有实例方法的支持以及一些围绕 Flow 和 TypeScript 类的 bug 修复。

更新亮点

Private Instance Methods (#8654)

class Person {
  #age = 19;

  #increaseAge() {
    this.#age++;
  }

  birthday() {
    this.#increaseAge();
    alert("Happy Birthday!");
  }
}

"Smart" Pipeline Operator Parsing (#8289)

// "Smart"
const result = 2 |> double |> 3 + # |> toStringBase(2, #); // "111"

// "Simple"
const result = 2 |> double |> (x => 3 + x) |> (x => toStringBase(2, x));

Plugin Names (#8769)

发行说明:

https://babeljs.io/blog/2018/12/03/7.2.0

猜你喜欢

转载自www.oschina.net/news/102400/babel-7-2-0-released