Function.prototype.method=function(name,fun){
if(!this.prototype[name])
this.prototype[name]=fun;
}
String.method('deentityify',function(){
var entity={
quot:'"',
lt:'<',
gt:'>'
}
console.log(1);
return function(){
return this.replace(/&([^&;]+);/g,function(a,b){
var ret=entity[b];
return typeof ret==='string'?ret:a
})
}
}());
var str='<">'
str.deentityify()
if(!this.prototype[name])
this.prototype[name]=fun;
}
String.method('deentityify',function(){
var entity={
quot:'"',
lt:'<',
gt:'>'
}
console.log(1);
return function(){
return this.replace(/&([^&;]+);/g,function(a,b){
var ret=entity[b];
return typeof ret==='string'?ret:a
})
}
}());
var str='<">'
str.deentityify()