lessfish / underscore-analysis

【NO LONGER UPDATE】underscore-1.8.3.js 源码解读 & 系列文章(完)
MIT License
3.96k stars 643 forks source link

指出版本问题 #11

Closed zhoucumt closed 8 years ago

zhoucumt commented 8 years ago

首先,非常感谢楼主的分享,也说明一下,我没有挑刺的意思。看了一下,你这里说的是underscore1.8.3的源码,事实上,你这个是1.8.2的版本啊,underscore1.8.3里面,对于root的定义已经变成了这样了: var root = typeof self == 'object' && self.self === self && self || typeof global == 'object' && global.global === global && global || this;

我也最近才开始看underscore源码,我就是看的1.8.3,结果发现和楼主这里的源码不一样。 最后,还请多多指教。谢谢!

lessfish commented 8 years ago

@zhoucumt 你好。你看的应该是 https://github.com/jashkenas/underscore/blob/master/underscore.js 吧?这是还没 release 的版本,Unreleased, current master, use at your own riskhttp://underscorejs.org/)。而我看的应该是 release 的版本,可以和 http://underscorejs.org/docs/underscore.html 对照。事实上,我发现过那个 Edge Version 的 bug,详见 http://www.cnblogs.com/zichi/p/5331426.html,所以没看那个版本的

而且源码中有版本说明的,_.VERSION = '1.8.3';,这点应该不会错。

zhoucumt commented 8 years ago

非常感谢,学习了。已star,已watch. @hanzichi

lessfish commented 8 years ago

@zhoucumt 感谢支持~!