// Function.prototype.call2 = function(context){
// context.fn = this
// context.fn()
// delete context.fn
// }
// var foo = {
// val: 1234
// }
// function boor(name,age){
// console.log(name)
// console.log(age)
// console.log(this.val)
// }
// // boor.call2(foo,'zhu','9')
// boor.call(foo,'zhu','9')
Function.prototype.call2 = function(context){
context.fn = this
var ags = []
for(var i =1;i<arguments.length;i++){
ags.push('arguments[' + i + ']')
}
eval('context.fn(' + ags +')')
delete context.fn
}
var foo = {
val: 1234
}
function boor(name,age){
console.log(name)
console.log(age)
console.log(this.val)
}
// boor.call2(foo,'zhu','9')
boor.call2(foo,'zhu','9')
console