GitHub 博客园 Nanakon

【avalon源码】scpCompile

function noop() {}
function scpCompile(array) {
    return Function.apply(noop, array)
}

// var fn = new Function('x', 'y', 'return x + y;');
// 等价于var fn = function(x, y) {return x + y;}

var fn = scpCompile(['x', 'y', 'return x + y;'])
console.log(fn)

 

posted on 2016-12-14 17:33  jzm17173  阅读(145)  评论(0)    收藏  举报

导航

轻音