严格模式下报错 'caller', 'callee', and 'arguments' properties

input.on( 'change', function( e ) {
                    var fn = arguments.callee,
                        clone;

                    me.files = e.target.files;

                    // reset input
                    clone = this.cloneNode( true );
                    clone.value = null;
                    this.parentNode.replaceChild( clone, this );

                    input.off();
                    input = $( clone ).on( 'change', fn )
                            .on( 'mouseenter mouseleave', mouseHandler );

                    owner.trigger('change');
                });

                label.on( 'mouseenter mouseleave', mouseHandler );

图片描述

阅读 4k
2 个回答

严格模式不支持arguments.callee

严格模式不支持arguments.caller、arguments.callee。
如果你要调用自己,给你的匿名函数起个名字就好。
比方说:settimeout(function foo(){... foo();})

推荐问题