MCPcopy Create free account
hub / github.com/ygs-code/vue / polyfillBind

Function polyfillBind

vue.js:288–300  ·  view source on GitHub ↗
(fn, ctx)

Source from the content-addressed store, hash-verified

286 /* istanbul ignore next */
287 //绑定事件 并且改变上下文指向
288 function polyfillBind(fn, ctx) {
289 function boundFn(a) {
290 var l = arguments.length;
291 return l
292 ? l > 1
293 ? fn.apply(ctx, arguments)
294 : fn.call(ctx, a)
295 : fn.call(ctx)
296 }
297
298 boundFn._length = fn.length;
299 return boundFn
300 }
301
302 //执行方式
303 function nativeBind(fn, ctx) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected