代碼就是從這裏開始:https://github.com/facebook/flux/blob/c62ad1e76f00b880df8e55b00aa9296b627e0ab7/src/Dispatcher.js#L111:爲什麼Flux可以在Javascript中使用「class」?
class Dispatcher {
constructor() {
this._callbacks = {};
this._isPending = {};
...
什麼樣的語法在這裏它使用?據我所知,「class」是Javascript 2.0中的一項重要工作,而許多瀏覽器都不支持它。爲什麼在這裏使用它?它工作嗎?
「Class」不是ECMAScript [*關鍵詞*](http://ecma-international.org/ecma-262/5.1/#sec-7.6.1.1),它是[*未來的保留字* ](http://ecma-international.org/ecma-262/5.1/#sec-7.6.1.2)。 ;-)由於ECMA-262 ed 6是一個可能的未來,它有[*類*](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-class-definitions)。至少目前來說。 – RobG 2014-10-31 06:23:17