摘要:我在看sizzle和peppy的源代码,发现他们的速度还有提升的空间, 我准备使用jit技术实现一个世界最快的javascript css3 selector engine. css3选择器也有一些不方便 比如说伪类选择器,只运行"且"选择,不运行"或"选择,要"或"的话,把前面的抄下来吧,效率低多了. 经过jit编译过后的selector成为一个函数,接受一个参数ct,表示容器.选择器将从这...
阅读全文
摘要:代码是随手写的,只提供思路。 这个原理很简单,看代码就懂,不多说了。 Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->(function (){ var h = 0; handle = function (){return h++};...
阅读全文
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->(function (Package){ var _key = {}; var ClassA = function (key_){ if (_key !== ke...
阅读全文
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->function t(){ var fns = Array.prototype.concat.apply([], arguments); for (var i = 0; i < ...
阅读全文
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->function NewClasse(superclass){ return function classe(){ if (classe.prototype != sup...
阅读全文
摘要:主要实现了类似jsp里的el表达式的功能,甚至于比el表达式更加强大。 思路很简单,就是利用eval绑定可见域。利用这个思路可以作出很多强大的东西。 当前其中也用到了String.prototype.replace的强大功能。 Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.Cod...
阅读全文
摘要:注意这里使用Function来避免eval的可见域问题。 Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> function loadModule(/*Module*/mod/*location*/, /*Function*/cb/*ca...
阅读全文
摘要:没想到代码一次测试成功.~~只不过是FF下面,修改一下支持IE了。由于IE不认function表达式. Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->var Iterator = function (fn) { var corou...
阅读全文
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->function A () { A.prototype._ = A; if (this._ === A) { alert('new call') } el...
阅读全文