Skip to content

Commit

Permalink
修复css中url(xxx )代码xx之后有空格的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyunlong committed Oct 29, 2013
1 parent 5b84222 commit 00089fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# FIS Kernel

This is fis kernel.

这个分支用来做一些源码分析注释。
This is fis kernel.
19 changes: 2 additions & 17 deletions fis-kernel.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
var last = Date.now();

//oo
var superTest = /\b_super\b/;
Function.prototype.derive = function(constructor, proto){
if(typeof constructor === 'object'){
proto = constructor;
Expand All @@ -21,33 +20,19 @@ Function.prototype.derive = function(constructor, proto){
constructor.apply(this, arguments);
};
var tmp = function(){};
var addSuper = function(name, fn, parent) {
return function() {
var temp = this._super;
this._super = parent[name];
var ret = fn.apply(this, arguments);
this._super = temp;
return ret;
}
}
tmp.prototype = parent.prototype;
var fp = new tmp(),
cp = constructor.prototype,
pp = parent.prototype,
key;
for(key in cp){
if(cp.hasOwnProperty(key)){
fp[key] =
(typeof cp[key] === 'function' && typeof pp[name] === 'function' && superTest.test(cp[key])) ? addSuper(key, cp[key],pp) :
cp[key];
fp[key] = cp[key];
}
}
proto = proto || {};
for(key in proto){
if(proto.hasOwnProperty(key)){
fp[key] =
(typeof proto[key] === 'function' && (typeof cp[key] === 'function' || typeof pp[key] === 'function') && superTest.test(proto[key])) ? addSuper(key, proto[key], typeof cp[key] === 'function' ? cp : pp) :
proto[key];
fp[key] = proto[key];
}
}
fp.constructor = constructor.prototype.constructor;
Expand Down

0 comments on commit 00089fc

Please sign in to comment.