Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在Chrome中,JS绑定函数具有空参数。callee.caller_Javascript_Google Chrome_Arguments_V8_Ecmascript 5 - Fatal编程技术网

Javascript 在Chrome中,JS绑定函数具有空参数。callee.caller

Javascript 在Chrome中,JS绑定函数具有空参数。callee.caller,javascript,google-chrome,arguments,v8,ecmascript-5,Javascript,Google Chrome,Arguments,V8,Ecmascript 5,从Chrome 17开始,对于绑定函数,arguments.callee.caller似乎为null: function a() { this.test = function() { console.debug('*** ' + arguments.callee.caller); }; this.test(); // This prints the function this.bound = this.test.bind(this); this.bound(); // This

从Chrome 17开始,对于绑定函数,arguments.callee.caller似乎为null:

function a() {
  this.test = function() { console.debug('*** ' + arguments.callee.caller); };
  this.test();  // This prints the function
  this.bound = this.test.bind(this);
  this.bound(); // This prints null
}
绑定函数和未绑定函数过去一直起作用,但现在不再起作用


这是预期的行为吗

也许这不是一个错误。您可能会注意到:
如果函数f由顶级代码调用,则f.caller的值为null,否则调用f的就是函数。

当你在函数a中使用它时,
'this'
意味着
DOMWindow
。因此,当您将绑定函数绑定到此时,顶级代码会调用绑定函数。它返回
null


愿它有帮助。rdtriny.

参数。不推荐使用被调用方和公司。他们在严格模式下抛出错误。我的猜测是,新版本的Chrome正在逐步淘汰它们。不过,我无法确认,因为我仍在16岁。

您介意在上提交一个bug并在这里发布ID吗?我并不认为这个结果是错误的,但这可能是更改WebCore和V8之间的绑定的无意结果。