https://github.com/ruby-china/ruby-china/issues/218
CURRENT_USER_ACCESS_TOKEN = "xxxxx" // 全局变量,的确在window里。
return unless ('CURRENT_USER_ACCESS_TOKEN' in window)
in
被翻译成了
var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
'CURRENT_USER_ACCESS_TOKEN' in window 永远返回是 false。faye client 就没法初始化了。
求解!